SlowGuess commited on
Commit
25bce2e
·
verified ·
1 Parent(s): d67136d

Add Batch eb6257de-20f0-4a96-84c6-03e2f0a983f5

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_content_list.json +3 -0
  2. scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_model.json +3 -0
  3. scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_origin.pdf +3 -0
  4. scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/full.md +613 -0
  5. scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/images.zip +3 -0
  6. scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/layout.json +3 -0
  7. scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_content_list.json +3 -0
  8. scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_model.json +3 -0
  9. scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_origin.pdf +3 -0
  10. scalablespikeandslab/full.md +0 -0
  11. scalablespikeandslab/images.zip +3 -0
  12. scalablespikeandslab/layout.json +3 -0
  13. scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_content_list.json +3 -0
  14. scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_model.json +3 -0
  15. scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_origin.pdf +3 -0
  16. scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/full.md +562 -0
  17. scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/images.zip +3 -0
  18. scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/layout.json +3 -0
  19. scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_content_list.json +3 -0
  20. scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_model.json +3 -0
  21. scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_origin.pdf +3 -0
  22. scalingoutofdistributiondetectionforrealworldsettings/full.md +326 -0
  23. scalingoutofdistributiondetectionforrealworldsettings/images.zip +3 -0
  24. scalingoutofdistributiondetectionforrealworldsettings/layout.json +3 -0
  25. scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_content_list.json +3 -0
  26. scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_model.json +3 -0
  27. scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_origin.pdf +3 -0
  28. scalingstructuredinferencewithrandomization/full.md +738 -0
  29. scalingstructuredinferencewithrandomization/images.zip +3 -0
  30. scalingstructuredinferencewithrandomization/layout.json +3 -0
  31. scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_content_list.json +3 -0
  32. scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_model.json +3 -0
  33. scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_origin.pdf +3 -0
  34. scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/full.md +0 -0
  35. scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/images.zip +3 -0
  36. scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/layout.json +3 -0
  37. scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_content_list.json +3 -0
  38. scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_model.json +3 -0
  39. scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_origin.pdf +3 -0
  40. scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/full.md +0 -0
  41. scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/images.zip +3 -0
  42. scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/layout.json +3 -0
  43. scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_content_list.json +3 -0
  44. scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_model.json +3 -0
  45. scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_origin.pdf +3 -0
  46. scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/full.md +0 -0
  47. scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/images.zip +3 -0
  48. scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/layout.json +3 -0
  49. scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_content_list.json +3 -0
  50. scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_model.json +3 -0
scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc10f977b9ae4134064643b8daca6bad257c3bd555ea5d3c6f2329bf512aabac
3
+ size 138984
scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a54d1cbed548506a3ec87d9295e66bc99471139e1d735f7d2bd1c859388593d
3
+ size 165952
scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/db7abe09-3502-468a-b76c-b6441ac14a21_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aba68ec78d6eb0935b1374b70c087cb313840b54aa6b4c75437978ff8be248e6
3
+ size 709974
scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/full.md ADDED
@@ -0,0 +1,613 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Scalable MCMC Sampling for Nonsymmetric Determinantal Point Processes
2
+
3
+ Insu Han<sup>1</sup> Mike Gartrell<sup>2</sup> Elvis Dohmatob<sup>3</sup> Amin Karbasi<sup>1</sup>
4
+
5
+ # Abstract
6
+
7
+ 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.
8
+
9
+ # 1. Introduction
10
+
11
+ 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
12
+
13
+ $^{1}$ Yale University $^{2}$ Criteo AI Lab, Paris, France $^{3}$ Facebook AI Lab, Paris, France. Correspondence to: Insu Han <insu.han@yale.edu>, Mike Gartrell <m.gartrell@criteo.com>.
14
+
15
+ Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s).
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ # 1.1. Contributions
22
+
23
+ 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-
24
+
25
+ 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).
26
+
27
+ <table><tr><td>Algorithm</td><td>Task</td><td>Preprocessing Time</td><td>Sampling Time</td></tr><tr><td>Cholesky-based Exact (Poulson, 2020)</td><td>NDPP</td><td>-</td><td>O(n·d2)</td></tr><tr><td>Rejection-based Exact (Han et al., 2022)</td><td>NDPP</td><td>O(n·d2)</td><td>O((log n·k3+k4+d)·(1+α)d)</td></tr><tr><td>Naïve MCMC (Alimohammadi et al., 2021)</td><td>k-NDPP / NDPP</td><td>-</td><td>O(n2·k3·titer)</td></tr><tr><td>Scalable MCMC (This work)</td><td>k-NDPP / NDPP</td><td>O(n·d2)</td><td>O((log n·d2+d3)·(1+κ)2·titer)</td></tr></table>
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ # 1.2. Related Work
34
+
35
+ 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.
36
+
37
+ # 2. Background
38
+
39
+ 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
40
+
41
+ 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]$ .
42
+
43
+ # 2.1. Nonsymmetric DPPs
44
+
45
+ Given a matrix $L\in \mathbb{R}^{n\times n}$ , a DPP assigns a probability
46
+
47
+ $$
48
+ \mathcal {P} _ {\boldsymbol {L}} (S) \propto \det (\boldsymbol {L} _ {S}) \tag {1}
49
+ $$
50
+
51
+ 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.
52
+
53
+ In particular, Gartrell et al. (2019) proposed a kernel construction for NDPPs that combines a symmetric PSD matrix and a skew-symmetric matrix:
54
+
55
+ $$
56
+ \boldsymbol {L} = \boldsymbol {V} \boldsymbol {V} ^ {\top} + \boldsymbol {B} (\boldsymbol {D} - \boldsymbol {D} ^ {\top}) \boldsymbol {B} ^ {\top}, \qquad (2)
57
+ $$
58
+
59
+ 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$ .
60
+
61
+ We refer to a $k$ -NDPP as a NDPP whose support is restricted to size- $k$ subsets of $[n]$ .<sup>1</sup> 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}$ .<sup>2</sup> Formally, when $\{\lambda_i\}_{i=1}^d$ are the nonzero eigenvalues of the rank- $d$ matrix $\pmb{L}$ , it holds that
62
+
63
+ $$
64
+ \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}
65
+ $$
66
+
67
+ 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:
68
+
69
+ $$
70
+ 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)
71
+ $$
72
+
73
+ 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.
74
+
75
+ # Algorithm 1 MCMC Sampling for $k$ -NDPP
76
+
77
+ 1: Input: $L \in \mathbb{R}^{n \times n}$ , $k \in \mathbb{N}$ , $t_{\mathrm{iter}} \in \mathbb{N}$
78
+ 2: Select $S \in \binom{n}{k}$ uniformly at random
79
+ 3: for $t = 1, \ldots, t_{\mathrm{iter}}$ do
80
+ 4: Select $A \in \binom{S}{k-2}$ uniformly at random
81
+ 5: Select $a, b \in [n]$ with probability $\propto \det(L_{A \cup \{a, b\}})$ ( $\triangleright$ Run Algorithm 2)
82
+ 6: $S\gets A\cup \{a,b\}$
83
+ 7: end for
84
+ 8: Return $S$
85
+
86
+ # 2.2. MCMC Sampling for $k$ -NDPPs
87
+
88
+ 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).
89
+
90
+ 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.
91
+
92
+ 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$ .
93
+
94
+ Proposition (Theorem 11 in (Alimohammadi et al., 2021)). For any $\varepsilon > 0$ , a sample $S$ obtained from Algorithm 1 with
95
+
96
+ $$
97
+ 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}
98
+ $$
99
+
100
+ 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$ .
101
+
102
+ 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".
103
+
104
+ # 3. Scalable MCMC Sampling for $k$ -NDPPs
105
+
106
+ As mentioned above, the naive up operator, which involves an exhaustive search over the space of possible candidates,
107
+
108
+ 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.
109
+
110
+ 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
111
+
112
+ $$
113
+ \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}
114
+ $$
115
+
116
+ 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.
117
+
118
+ # 3.1. Up Operator via Rejection Sampling
119
+
120
+ 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).
121
+
122
+ Specifically, given a NDPP kernel $L^A$ , assume that there exists a matrix $\widehat{L}$ such that
123
+
124
+ $$
125
+ \det \left(\boldsymbol {L} _ {S} ^ {A}\right) \leq \det (\widehat {\boldsymbol {L}} _ {S}) \tag {7}
126
+ $$
127
+
128
+ 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.
129
+
130
+ 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,
131
+
132
+ # Algorithm 2 Up Operator via Rejection Sampling
133
+
134
+ 1: Input: $A \subseteq [n]$ , $X \in \mathbb{R}^{n \times d}$ , $W \in \mathbb{R}^{d \times d}$
135
+ 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}$
136
+ 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}$
137
+ 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)$
138
+
139
+ # 5: while true do
140
+
141
+ 6: Sample $\{a,b\}$ with prob. $\propto \operatorname*{det}([X\widehat{W}^A X^\top ]_{\{a,b\}})$ (Run Algorithm 3)
142
+ 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
143
+ 8: Return $\{a, b\}$
144
+ 9: end if
145
+
146
+ # 10: end while
147
+
148
+ 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.
149
+
150
+ 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
151
+
152
+ $$
153
+ \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}
154
+ $$
155
+
156
+ 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:
157
+
158
+ $$
159
+ \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}
160
+ $$
161
+
162
+ 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}$ .
163
+
164
+ 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,
165
+
166
+ $$
167
+ \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}
168
+ $$
169
+
170
+ for every $S \subseteq [n]$ . In addition, equality holds when $|S| \geq d$ .
171
+
172
+ 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.
173
+
174
+ 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.
175
+
176
+ # 3.2. Sublinear-time Tree-based Sampling
177
+
178
+ 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})$ .
179
+
180
+ 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
181
+
182
+ $$
183
+ \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}
184
+ $$
185
+
186
+ 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
187
+
188
+ $$
189
+ \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}
190
+ $$
191
+
192
+ 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
193
+
194
+ # Algorithm 3 Tree-based $k$ -DPP Sampling
195
+
196
+ 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}$
197
+
198
+ 2: $\pmb{U} \gets (\widehat{\pmb{W}}^A)^{-\frac{1}{2}}$
199
+
200
+ 3: $\{(\pmb {v}_i,\lambda_i)\}_{i = 1}^d\gets$ Eigendecomp.of $U C U^{\top}$
201
+
202
+ 4: Select size $k$ subset $E$ with prob. $\propto \prod_{i\in E}\lambda_{i}$ (Run Algorithm 8 in (Kulesza & Taskar, 2012))
203
+
204
+ 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$
205
+
206
+ 6: $Y\gets \emptyset$
207
+
208
+ 7: for $j = 1, \dots, k$ do
209
+
210
+ 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))
211
+
212
+ 9: $Y\gets Y\cup \{a\}$
213
+
214
+ 10: $Q \gets Q - QX_{Y,:}^{\top}\left(X_{Y,:}QX_{Y,:}^{\top}\right)^{-1}X_{Y,:}Q$
215
+
216
+ 11: end for
217
+
218
+ 12: Return $Y$
219
+
220
+ 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.
221
+
222
+ Specifically, let $S \subseteq [n]$ be a subset that we wish to sample. For any $Y \subseteq [n]$ and $a \notin Y$ observe that
223
+
224
+ $$
225
+ \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}
226
+ $$
227
+
228
+ 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.
229
+
230
+ 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
231
+
232
+ $$
233
+ \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}
234
+ $$
235
+
236
+ 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
237
+
238
+ 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.
239
+
240
+ 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)$ .
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ # 4. Runtime Analysis
247
+
248
+ 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.
249
+
250
+ 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
251
+
252
+ $$
253
+ \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})}.
254
+ $$
255
+
256
+ and $\kappa \coloneqq \max_{A\subseteq [n],|A|\leq d - 2}\kappa_A$
257
+
258
+ We now provide an upper bound on the average number of rejections in Algorithm 2.
259
+
260
+ 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$ .
261
+
262
+ Proof Sketch. First, we observe that the average number of
263
+
264
+ rejections can be expressed as
265
+
266
+ $$
267
+ \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}
268
+ $$
269
+
270
+ 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.
271
+
272
+ 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$ .
273
+
274
+ Putting all of the above together, we provide the overall runtime for our MCMC sampling algorithm for $k$ -NDPPs in the following proposition.
275
+
276
+ 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.
277
+
278
+ 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.
279
+
280
+ # 5. Extension from $k$ -NDPPs to Unconstrained NDPPs
281
+
282
+ In this section we show that any $k$ -NDPP sampling algorithm can be transformed into an unconstrained-size NDPP
283
+
284
+ ![](images/693a7bf5bcf16223c87b1a5566bc637bd48c81584e83066b49aeeb3ef0911a8d.jpg)
285
+ (a) $k$ -NDPP
286
+
287
+ ![](images/cafd91e662da4359a74d9808b7e4529773303ddcbefe3f621f6d058c8dc20253.jpg)
288
+ (b) NDPP
289
+
290
+ ![](images/7d25eead61f256abb326ec73dadc6879bb022996908d975b2be53cf83280925a.jpg)
291
+ 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.
292
+ (a)
293
+ 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$ .
294
+
295
+ ![](images/ffae2c69d7cd319d793986f1c4df8b7a2dac49bf521bc8dd713592f84d836347.jpg)
296
+ (b)
297
+
298
+ # Algorithm 4 MCMC Sampling for NDPP
299
+
300
+ 1: Input: $\mathbf{X} \in \mathbb{R}^{n \times d}$ , $\mathbf{W} \in \mathbb{R}^{d \times d}$
301
+ 2: $\{(\lambda_i, \boldsymbol{v}_i)\}_{i=1}^d \gets$ Eigendecomp. of $\boldsymbol{W} \boldsymbol{X}^\top \boldsymbol{X}$
302
+ 3: Compute elementary symmetric polynomials $\{e_k\}_{k=0}^d$ of $\{\lambda_i\}_{i=1}^d$ ( $\triangleright$ Run Algorithm 7 in (Kulesza & Taskar, 2012))
303
+ 4: Sample $k \in \{ 0,1,\ldots ,d\}$ with prob. $\propto {e}_{k}$
304
+ 5: Compute $t_{\mathrm{iter}}$ with the chosen $k$ (e.g., $t_{\mathrm{iter}} = k^2$ )
305
+ 6: Construct a binary tree $\mathcal{T}$ with $X$
306
+ 7: $S\gets$ Run Algorithm 1 with $\mathcal{T},\mathbf{X},\mathbf{W},k,t_{\mathrm{iter}}$
307
+ 8: Return $S$
308
+
309
+ 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.
310
+
311
+ 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.
312
+
313
+ We describe the overall runtime of Algorithm 4 in the following proposition.
314
+
315
+ 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.
316
+
317
+ 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.
318
+
319
+ # 6. Experiments
320
+
321
+ In this section, we report empirical results for our experiments involving several NDPP sampling algorithms, for NDPPs with and without size constraints.
322
+
323
+ # 6.1. Convergence of MCMC Sampling
324
+
325
+ 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
326
+
327
+ 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.
328
+
329
+ <table><tr><td>Task</td><td>Metric</td><td>Algorithm</td><td>UK Retail
330
+ n = 3,941</td><td>Recipe
331
+ n = 7,993</td><td>Instacart
332
+ n = 49,677</td><td>Million Song
333
+ n = 371,410</td><td>Book
334
+ n = 1,059,437</td></tr><tr><td rowspan="4">k=10</td><td rowspan="2">Runtime</td><td>Exact (Rejection)</td><td>406</td><td>2.1</td><td>93.7</td><td>0.13</td><td>0.46</td></tr><tr><td>MCMC (Ours)</td><td>25.4</td><td>14.5</td><td>21.0</td><td>9.5</td><td>23.7</td></tr><tr><td rowspan="2"># of Rejections</td><td>Exact (Rejection)</td><td>20880</td><td>79.2</td><td>3102</td><td>2.2</td><td>8.5</td></tr><tr><td>MCMC (Ours)</td><td>7.8</td><td>3.5</td><td>6.0</td><td>0.8</td><td>6.8</td></tr><tr><td rowspan="4">k=50</td><td rowspan="2">Runtime</td><td>Exact (Rejection)</td><td>(*)5.11×1012</td><td>(*)9.55×105</td><td>(*)9.50×105</td><td>(*)1.45×1012</td><td>(*)4.06×106</td></tr><tr><td>MCMC (Ours)</td><td>334</td><td>229</td><td>242</td><td>488</td><td>374</td></tr><tr><td rowspan="2"># of Rejections</td><td>Exact (Rejection)</td><td>(*)2.83×1013</td><td>(*)4.94×106</td><td>(*)4.63×106</td><td>(*)4.66×1012</td><td>(*)1.65×107</td></tr><tr><td>MCMC (Ours)</td><td>3.8</td><td>1.3</td><td>1.6</td><td>5.4</td><td>3.2</td></tr><tr><td rowspan="5">Unconstrained</td><td rowspan="3">Runtime</td><td>Exact (Cholesky)</td><td>5.6</td><td>11.5</td><td>71.1</td><td>537</td><td>1540</td></tr><tr><td>Exact (Rejection)</td><td>(*)1.34×108</td><td>1.0</td><td>1351.6</td><td>(*)1.89×1010</td><td>1022</td></tr><tr><td>MCMC (Ours)</td><td>75.3</td><td>11.8</td><td>21</td><td>281</td><td>80</td></tr><tr><td rowspan="2"># of Rejections</td><td>Exact (Rejection)</td><td>(*)1.50×109</td><td>45.3</td><td>27941.7</td><td>(*)6.91×1010</td><td>13924.5</td></tr><tr><td>MCMC (Ours)</td><td>6.0</td><td>3.6</td><td>5.7</td><td>7.2</td><td>9.8</td></tr><tr><td>Preprocessing</td><td>Runtime</td><td>MCMC (Ours)</td><td>1.0</td><td>2.2</td><td>14.0</td><td>30.8</td><td>74.3</td></tr></table>
335
+
336
+ 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).
337
+
338
+ # 6.2. Runtimes for Synthetic Datasets
339
+
340
+ 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$ .
341
+
342
+ # 6.3. Runtimes for Recommendation Datasets
343
+
344
+ 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).<sup>3</sup> 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.
345
+
346
+ We observe that for the 10-NDPP, the exact sampling algo
347
+
348
+ 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.
349
+
350
+ # 7. Conclusion
351
+
352
+ 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.
353
+
354
+ # Acknowledgement
355
+
356
+ 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).
357
+
358
+ # References
359
+
360
+ 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.
361
+ Anari, N. and Vuong, T.-D. From Sampling to Optimization on Discrete Domains with Applications to Determinant Maximization. arXiv preprint arXiv:2102.05347, 2021.
362
+ Anari, N., Gharan, S. O., and Rezaei, A. Monte Carlo Markov Chain Algorithms for Sampling Strongly
363
+
364
+ Rayleigh Distributions and Determinantal Point Processes. In Conference on Learning Theory (COLT), 2016.
365
+ 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.
366
+ 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.
367
+ Derezinski, M. Fast determinantal point processes via distortion-free intermediate sampling. In Conference on Learning Theory (COLT), 2019.
368
+ Dupuy, C. and Bach, F. Learning determinantal point processes in sublinear time. In Conference on Artificial Intelligence and Statistics (AISTATS), 2018.
369
+ Gartrell, M., Brunel, V.-E., Dohmatob, E., and Krichene, S. Learning Nonsymmetric Determinantal Point Processes. In Neural Information Processing Systems (NeurIPS), 2019.
370
+ 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.
371
+ Gelman, A. and Rubin, D. B. Inference from iterative simulation using multiple sequences. Statistical science, 1992.
372
+ 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.
373
+ 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.
374
+ 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.
375
+ Instacart. The Instacart Online Grocery Shopping Dataset, 2017. URL https://www.instacart.com/datasets/grocery-shopping-2017. Accessed May 2020.
376
+ Kathuria, T., Deshpande, A., and Kohli, P. Batched gaussian process bandit optimization via determinantal point processes. Neural Information Processing Systems (NIPS), 2016.
377
+
378
+ Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
379
+ Kulesza, A. and Taskar, B. k-DPPs: Fixed-size Determinantal Point Processes. In International Conference on Machine Learning (ICML), 2011.
380
+ Kulesza, A. and Taskar, B. Determinantal Point Processes for Machine Learning. Foundations and Trends® in Machine Learning, 2012.
381
+ 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.
382
+ 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.
383
+ 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.
384
+ 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.
385
+ Poulson, J. High-performance sampling of generic Determinantal Point Processes. Philosophical Transactions of the Royal Society A, 2020.
386
+ 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.
387
+ 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.
388
+ Tremblay, N., Barthelmé, S., and Amblard, P.-O. Determinantal Point Processes for Coresets. Journal of Machine Learning Research (JMLR), 2019.
389
+ Wan, M. and McAuley, J. Item recommendation on monotonic behavior chains. In Conference on Recommender Systems (RecSys), 2018.
390
+ 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.
391
+
392
+ Youla, D. A normal form for a matrix under the unitary congruence group. Canadian Journal of Mathematics, 1961.
393
+ Zhang, C., Kjellström, H., and Mandt, S. Determinantal Point Processes for Mini-Batch Diversification. In Conference on Uncertainty in Artificial Intelligence (UAI), 2017.
394
+
395
+ # A. Additional Details on Experimental Results
396
+
397
+ # A.1. Efficient Tree Construction
398
+
399
+ 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.
400
+
401
+ # A.2. Full Details on Datasets
402
+
403
+ We perform experiments on the following real-world public datasets:
404
+
405
+ - 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.
406
+ - 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.
407
+ - Instacart: This dataset (Instacart, 2017) contains baskets purchased by Instacart users<sup>5</sup>. We omit baskets with more than 100 items, resulting in 3.2 million baskets and a catalog of 49,677 products.
408
+ - Million Song: This dataset (McFee et al., 2012) contains playlists ("baskets") of songs from Echo Nest users<sup>6</sup>. We trim playlists with more than 100 items, leaving 968,674 playlists and a catalog of 371,410 songs.
409
+ - Book: This dataset (Wan & McAuley, 2018) contains reviews from the Goodreads book review website, including a variety of attributes describing the items<sup>7</sup>. 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.
410
+
411
+ # A.3. Full Details on Experimental Setup
412
+
413
+ 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\}$ :
414
+
415
+ $$
416
+ \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}
417
+ $$
418
+
419
+ 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,
420
+
421
+ 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.
422
+
423
+ <table><tr><td>Task</td><td>Metric</td><td>Algorithm</td><td>UK Retail
424
+ n=3,941</td><td>Recipe
425
+ n=7,993</td><td>Instacart
426
+ n=49,677</td><td>Million Song
427
+ n=371,410</td><td>Book
428
+ n=1,059,437</td></tr><tr><td rowspan="4">k=10</td><td rowspan="2">Runtime</td><td>Exact (Rejection)</td><td>0.04</td><td>0.6</td><td>1.9</td><td>0.2</td><td>0.8</td></tr><tr><td>MCMC (Ours)</td><td>6.5</td><td>9.0</td><td>11.8</td><td>8.3</td><td>10.7</td></tr><tr><td rowspan="2"># of Rejections</td><td>Exact (Rejection)</td><td>0</td><td>12.4</td><td>36.6</td><td>2.1</td><td>13.4</td></tr><tr><td>MCMC (Ours)</td><td>0</td><td>0.9</td><td>1.3</td><td>0.3</td><td>0.9</td></tr><tr><td rowspan="4">k=50</td><td rowspan="2">Runtime</td><td>Exact (Rejection)</td><td>0.4</td><td>(*)7.33×109</td><td>(*)1.92×108</td><td>99.1</td><td>(*)7.95×106</td></tr><tr><td>MCMC (Ours)</td><td>140.7</td><td>450.8</td><td>307.9</td><td>182.9</td><td>285.2</td></tr><tr><td rowspan="2"># of Rejections</td><td>Exact (Rejection)</td><td>0.1</td><td>(*)2.08×108</td><td>(*)4.96×108</td><td>239.7</td><td>(*)1.61×107</td></tr><tr><td>MCMC (Ours)</td><td>0.1</td><td>6.2</td><td>2.6</td><td>0.5</td><td>2.1</td></tr><tr><td rowspan="4">Unconstrained</td><td rowspan="2">Runtime</td><td>Exact (Rejection)</td><td>0.1</td><td>0.7</td><td>6.0</td><td>7.5</td><td>2.8</td></tr><tr><td>MCMC (Ours)</td><td>23.1</td><td>8.3</td><td>11.7</td><td>81.3</td><td>17.1</td></tr><tr><td rowspan="2"># of Rejections</td><td>Exact (Rejection)</td><td>0.1</td><td>15.0</td><td>91.6</td><td>27.5</td><td>34.0</td></tr><tr><td>MCMC (Ours)</td><td>0.0</td><td>1.1</td><td>1.3</td><td>0.4</td><td>0.9</td></tr></table>
429
+
430
+ 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.
431
+
432
+ 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
433
+
434
+ $$
435
+ \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}
436
+ $$
437
+
438
+ and $\sigma_{j} > 0$ . The training objective is
439
+
440
+ $$
441
+ \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}
442
+ $$
443
+
444
+ 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.
445
+
446
+ # A.4. Additional Experiments with ONDPPs
447
+
448
+ 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.
449
+
450
+ # A.5. Empirical Mixing Time with Potential Scale Reduction Factor (PSRF)
451
+
452
+ 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.
453
+
454
+ ![](images/f4eb9e8f8a11c55b62bf91db3a5b7b74caf081fa173cbb35f5a4c4086dbcbb1c.jpg)
455
+ Figure 3. Empirical mixing time, computed using Potential Scale Reduction Factor (PSRF), for our proposed NDPP MCMC sampling algorithm.
456
+
457
+ # B. MAP Inference for Initialization
458
+
459
+ 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,
460
+
461
+ $$
462
+ \operatorname *{argmax}_{\substack{S\in \binom {[n]}{k}}}\det (L_{S}).
463
+ $$
464
+
465
+ 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.
466
+
467
+ 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.
468
+
469
+ # C. Proofs
470
+
471
+ # C.1. Proof of Theorem 1
472
+
473
+ 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,
474
+
475
+ $$
476
+ \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}
477
+ $$
478
+
479
+ for every $S \subseteq [n]$ . In addition, equality holds when $|S| \geq d$ .
480
+
481
+ 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
482
+
483
+ $$
484
+ \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}
485
+ $$
486
+
487
+ where $\pmb{I}$ is the $|S|$ -by- $|S|$ identity matrix. Similarly,
488
+
489
+ $$
490
+ \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}
491
+ $$
492
+
493
+ From Theorem 2.1 in (Kulesza & Taskar, 2012), we have
494
+
495
+ $$
496
+ \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}
497
+ $$
498
+
499
+ $$
500
+ \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}
501
+ $$
502
+
503
+ Therefore, it is enough to prove that for every $T \subseteq [|S|]$
504
+
505
+ $$
506
+ \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}
507
+ $$
508
+
509
+ Now consider the Youla decomposition on $\frac{W^A - W^{A^\top}}{2}$ as in Equation (8), i.e.,
510
+
511
+ $$
512
+ \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}
513
+ $$
514
+
515
+ where $\pmb{V} := [y_1, z_1, \dots, y_{\frac{d}{2}}, z_{\frac{d}{2}}]$ . Then, it can be written
516
+
517
+ $$
518
+ \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}
519
+ $$
520
+
521
+ $$
522
+ \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}
523
+ $$
524
+
525
+ 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.
526
+
527
+ # C.2. Proof of Theorem 2
528
+
529
+ 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)$ .
530
+
531
+ 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.
532
+
533
+ # C.3. Proof of Theorem 4
534
+
535
+ 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$ .
536
+
537
+ 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
538
+
539
+ $$
540
+ \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}
541
+ $$
542
+
543
+ where the inequality comes from Theorem 1. This tells us that the average number of rejections is equal to
544
+
545
+ $$
546
+ \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}
547
+ $$
548
+
549
+ Instead of finding an upper bound on the above directly, we consider the following
550
+
551
+ $$
552
+ \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\}})},
553
+ $$
554
+
555
+ which is greater than or equal to expression (26).
556
+
557
+ 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
558
+
559
+ $$
560
+ \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}
561
+ $$
562
+
563
+ 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$
564
+
565
+ Assume that $\operatorname*{det}([X\mathbf{S}\mathbf{X}^{\top}]_{Y})\neq 0$ , then
566
+
567
+ $$
568
+ \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}
569
+ $$
570
+
571
+ 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
572
+
573
+ $$
574
+ \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}
575
+ $$
576
+
577
+ 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
578
+
579
+ $$
580
+ \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}.
581
+ $$
582
+
583
+ 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,
584
+
585
+ $$
586
+ \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}
587
+ $$
588
+
589
+ In addition, we have
590
+
591
+ $$
592
+ \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}
593
+ $$
594
+
595
+ Putting Equations (40) and (41) into Equation (39) gives
596
+
597
+ $$
598
+ \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}
599
+ $$
600
+
601
+ where, in Definition 3, $\kappa_{A}$ is defined as
602
+
603
+ $$
604
+ \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})}.
605
+ $$
606
+
607
+ This completes the proof of Theorem 4.
608
+
609
+ # C.4. Proof of Proposition 5
610
+
611
+ 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.
612
+
613
+ 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.
scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5435cb546cf2f84ce8491ac38b1fd85fd52de281b7f08dc0c5ae9b0579936aef
3
+ size 746380
scalablemcmcsamplingfornonsymmetricdeterminantalpointprocesses/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b190a5d2289b5c74ca6af0893ec20eb50595ff45af7d136e38e31ef3ea9ecd5
3
+ size 1027122
scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a4129128cfe72d4ef9bb09d71dd194f26a3e1d5c5fba99db5daebc1c671f0df
3
+ size 154134
scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8d9bfdb02f570d87bd193be090a03f9e65ddd875a25462918b19086d30842dc
3
+ size 190616
scalablespikeandslab/c6a3502d-b1f3-4641-8492-0b1e6c9f1e4f_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd09920c2b03d4a6abec9343d132d082450a2d6e3324aecaf9af2c881b61f52b
3
+ size 3657084
scalablespikeandslab/full.md ADDED
The diff for this file is too large to render. See raw diff
 
scalablespikeandslab/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7aaeb3efb509676d7fe2fe353abbfd4c21decc3e49ae68fdfb4e07fba2093f53
3
+ size 953715
scalablespikeandslab/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2190020d5cefdfa3b2c85c060efa0dad1c8a7b04de368b64a3402fdbd512cb9a
3
+ size 1247432
scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b882efc2dfd2f80b5c6a3605737495d60614cde080d2e680424b4b42729fa1e1
3
+ size 133789
scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fdd16ae99064500c5282e0463b7f9f360dd3710368a21a3f59cc7ab74e8a230
3
+ size 157370
scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/6624daf1-f625-4f89-a23d-79db120494f7_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a957b91d5c06174bef7fe017032d8509d127f2346ed59ed60c5feac076db1970
3
+ size 805471
scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/full.md ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Scaling Gaussian Process Optimization by Evaluating a Few Unique Candidates Multiple Times
2
+
3
+ Daniele Calandriello<sup>1</sup> Luigi Carratino<sup>2</sup> Alessandro Lazaric<sup>3</sup> Michal Valko<sup>1</sup> Lorenzo Rosasco<sup>2,4,5</sup>
4
+
5
+ # Abstract
6
+
7
+ 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.
8
+
9
+ $^{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 <dcalandriello@google.com>.
10
+
11
+ Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s).
12
+
13
+ # 1. Introduction
14
+
15
+ 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:
16
+
17
+ (1) selects candidate $\mathbf{x}_t\in \mathcal{A}$ by maximizing an acquisition function $u_{t}$ as a surrogate of $f$
18
+ (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})$ ;
19
+ (3) uses $y_{t}$ to improve $u_{t}$ 's approximation of $f$ .
20
+
21
+ 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).
22
+
23
+ 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.
24
+
25
+ # 1.1. Approaches to scalable no-regret GP optimization
26
+
27
+ 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.
28
+
29
+ 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).
30
+
31
+ 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).
32
+
33
+ # 1.2. Contributions
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ 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,
42
+
43
+ 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.
44
+
45
+ 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).
46
+
47
+ 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.
48
+
49
+ # 2. Preliminaries
50
+
51
+ 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)$ .
52
+
53
+ 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
54
+
55
+ $$
56
+ \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}
57
+ $$
58
+
59
+ # Algorithm 1 Optimistic GP optimization
60
+
61
+ Require: Set of candidates $\mathcal{A}$ , acq. func. $u_0$
62
+
63
+ 1: Initialize $t = 0$
64
+ 2: for $t = \{1, \dots, T\}$ do
65
+ 3: Select $\mathbf{x}_{t + 1} = \arg \max_{\mathbf{x}\in \mathcal{A}}u_t(\mathbf{x})$
66
+ 4: Get feedback $y_{t+1}$
67
+ 5: Update $\mu_t, \sigma_t, \beta_t$ and $u_t$
68
+ 6: end for
69
+
70
+ 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
71
+
72
+ $$
73
+ \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})).
74
+ $$
75
+
76
+ 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.
77
+
78
+ 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))
79
+
80
+ $$
81
+ \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}
82
+ $$
83
+
84
+ 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.
85
+
86
+ 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
87
+
88
+ # Algorithm 2 Meta-algorithm to minimize unique candidates (MINI-META)
89
+
90
+ Require: Set of candidates $\mathcal{A}$ , acq. func. $u_0$ , threshold $C$
91
+
92
+ 1: Initialize $t = 0$
93
+ 2: for $h = \{1, \ldots\}$ do
94
+ 3: Select $\mathbf{x}_{t + 1} = \arg \max_{\mathbf{x}\in \mathcal{A}}u_t(\mathbf{x})$
95
+ 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])$
96
+ 5: Get feedback $\{y_s\}_{s = t + 1}^{t + B_h}$
97
+ 6: Set $t = t + B_h$ , update posteriors $\mu_t, \sigma_t$ and acquisition function $u_t$
98
+ 7: end for
99
+
100
+ 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.
101
+
102
+ # 3. Efficient GP Optimization With Few Unique Candidates
103
+
104
+ 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.
105
+
106
+ # 3.1. A meta-algorithm to select few unique candidates
107
+
108
+ 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
109
+
110
+ optimization (Calandriello et al., 2020). Our final meta-algorithm MINI-META is reported in Algorithm 2.
111
+
112
+ 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.
113
+
114
+ 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.
115
+
116
+ 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.
117
+
118
+ # 3.2. GPs supported on few unique candidates.
119
+
120
+ 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
121
+
122
+ to merge feedbacks coming from two identical candidates selected in different epochs.
123
+
124
+ 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
125
+
126
+ $$
127
+ \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}
128
+ $$
129
+
130
+ 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$ .
131
+
132
+ 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.
133
+
134
+ # 4. Regret and computational meta-analysis
135
+
136
+ 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}}$ .
137
+
138
+ 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}$
139
+
140
+ $$
141
+ r _ {t} \stackrel {\mathrm {d e f}} {=} f ^ {\star} - f (\mathbf {x} _ {t}) \leq G _ {t} \sigma_ {t - 1} (\mathbf {x} _ {t}), \tag {5}
142
+ $$
143
+
144
+ 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.
145
+
146
+ 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})$ ).
147
+
148
+ 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.
149
+
150
+ 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.
151
+
152
+ 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
153
+
154
+ 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.
155
+
156
+ # 4.1. Regret meta-analysis details
157
+
158
+ 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.
159
+
160
+ 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).
161
+
162
+ Sketch of proof. Let $t$ be the first step of epoch/batch $h$ (i.e., we received feedback up to $t - 1$ ). Then
163
+
164
+ $$
165
+ \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}
166
+ $$
167
+
168
+ 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$ .
169
+
170
+ 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
171
+
172
+ form of additional randomness (e.g., random projections). In other words, our $\mu$ -variants are much more deterministic compared to other scalable methods.
173
+
174
+ # 4.2. Computational meta-analysis.
175
+
176
+ 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$ .
177
+
178
+ 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}$ .
179
+
180
+ 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.
181
+
182
+ 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))$ .
183
+
184
+ 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.
185
+
186
+ # 4.3. Instantiating the meta-analysis
187
+
188
+ 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.
189
+
190
+ MINI-GP-UCB We consider frequentist $(\| f\| \leq F)$ and Bayesian $(f\sim GP)$ settings.
191
+
192
+ 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
193
+
194
+ $$
195
+ \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).
196
+ $$
197
+
198
+ Then w.p. $1 - \delta$ , $R_{T} \leq \widetilde{\mathcal{O}}\left((\sqrt{\gamma_{T}} + F)C\sqrt{\gamma_{T}T}\right)$ .
199
+
200
+ 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.
201
+
202
+ 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$
203
+
204
+ $$
205
+ R _ {T} \leq \tilde {\mathcal {O}} (C \sqrt {T \gamma_ {T}})).
206
+ $$
207
+
208
+ 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$ .
209
+
210
+ MINI-GP-EI We can combine Theorem 4.1 with (Wang & de Freitas, 2014, Thm. 1) under frequentist assumptions.
211
+
212
+ 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}}$ ,
213
+
214
+ $$
215
+ \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}
216
+ $$
217
+
218
+ Then w.p. $1 - \delta$ , $R_{T} \leq \widetilde{\mathcal{O}}\left((\sqrt{\gamma_{T}} + F)C\sqrt{\gamma_{T}T}\right)$ .
219
+
220
+ 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.
221
+
222
+ # 4.4. Extension to continuous spaces
223
+
224
+ 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.
225
+
226
+ # 5. Experiments
227
+
228
+ We now evaluate our proposed approach empirically, focusing here on real-world data and on synthetic data in the
229
+
230
+ ![](images/0b9a8a89ad74613ada6a18500597946a89a40d316b5a6bead8cc7d2a732e2a5b.jpg)
231
+
232
+ ![](images/45013ac550ad11c4fa667fa634f577eae42c8538b6f9ab861d5fa4e22e66369a.jpg)
233
+ (a) $R_{t} / t$ against step $t$
234
+
235
+ ![](images/6a2b5e331ea0a1e2233f28a0da369837b967cf2e7c7e337efa87211c0cd21af7.jpg)
236
+ (b) $q_{t}$ against step $t$
237
+
238
+ ![](images/d5d6b10870a58a7936b4af703339cb8eeabb2c6a5a33a1a38c64d2db3f2b046e.jpg)
239
+ (c) $R_{T}$ against wall-clock time (s)
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ 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
246
+
247
+ ![](images/b816f90239790696e2dc781c29c0e7b76a322111db4e0f8e7137d87b13954161.jpg)
248
+ (d) Batch/epoch number $h$ against step $t$
249
+
250
+ ![](images/b8cf86d037c64c7beaeef808afe07716d3e95cfcddde17b15f3432a10cda1b00.jpg)
251
+ (e) $q_{t}$ against step $t$
252
+
253
+ 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}$ .
254
+
255
+ # 6. Conclusions, limitations and open questions
256
+
257
+ 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
258
+
259
+ 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.
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ 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.
266
+
267
+ 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.
268
+
269
+ # References
270
+
271
+ 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.
272
+ 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.
273
+ 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.
274
+ 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.
275
+ 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.
276
+ 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.
277
+ Chowdhury, S. R. and Gopalan, A. On kernelized multiarmed bandits. In International Conference on Machine Learning, pp. 844-853, 2017.
278
+ 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.
279
+ 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.
280
+ 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.
281
+ Gardner, J. R., Pleiss, G., Bindel, D., Weinberger, K. Q., and Wilson, A. G. Gpytorch: Blackbox matrix-matrix gaussian process inference withgpu acceleration. Advances
282
+
283
+ in Neural Information Processing Systems, 2018:7576-7586, 2018.
284
+ Jones, D. R. Direct global optimization algorithm
285
+ Global Optimization Algorithm, pp. 431-440. Springer
286
+ US, Boston, MA, 2001. ISBN 978-0-306-48332-5.
287
+ doi: 10.1007/0-306-48332-7_93. URL https://doi.org/10.1007/0-306-48332-7_93.
288
+ 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.
289
+ 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.
290
+ 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.
291
+ Lattimore, T. and Szepesvári, C. Bandit algorithms. Cambridge University Press, 2020.
292
+ 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.
293
+ Mockus, J. Bayesian approach to global optimization: theory and applications. 1989.
294
+ 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.
295
+ 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.
296
+ Quinonero-Candela, J., Rasmussen, C. E., and Williams, C. K. Approximation methods for gaussian process regression. Large-scale kernel machines, pp. 203-224, 2007.
297
+ 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.
298
+
299
+ 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.
300
+ 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.
301
+ 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.
302
+ 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.
303
+ Wang, Z. and de Freitas, N. Theoretical analysis of bayesian optimisation with unknown gaussian process hyperparameters. arXiv preprint arXiv:1406.7758, 2014.
304
+ 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.
305
+
306
+ # A. Proofs of Section 3
307
+
308
+ 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
309
+
310
+ $$
311
+ \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}
312
+ $$
313
+
314
+ which can be easily shown to be valid for any linear operator $\mathbf{B}$ using its singular value decomposition.
315
+
316
+ # A.1. Proof of equivalence between Equation 1 and Equation 4
317
+
318
+ 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
319
+
320
+ $$
321
+ \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}
322
+ $$
323
+
324
+ where in each passage
325
+
326
+ $a$ ) we simply apply the definition of $\mathrm{k}$ and $\varphi$
327
+ $b$ ) we apply Equation 6 with $\varphi (\mathbf{X})$ as $\mathbf{B}$
328
+ $c)$ we add and subtract $\lambda \mathbf{I}$ to highlight the presence of $\mathbf{V}_t$ in the reformulation;
329
+ $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)).
330
+
331
+ 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
332
+
333
+ $$
334
+ \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}
335
+ $$
336
+
337
+ 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
338
+
339
+ $$
340
+ \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}
341
+ $$
342
+
343
+ 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
344
+
345
+ $$
346
+ \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}
347
+ $$
348
+
349
+ 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
350
+
351
+ $$
352
+ \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}
353
+ $$
354
+
355
+ 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
356
+
357
+ $$
358
+ \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}
359
+ $$
360
+
361
+ which concludes the proof of the equivalence between Equation 1 and Equation 4.
362
+
363
+ 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.
364
+
365
+ # A.2. Proof of Lemma 4.3
366
+
367
+ We begin with the following result from (Calandriello et al., 2020).
368
+
369
+ 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'$
370
+
371
+ $$
372
+ 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}).
373
+ $$
374
+
375
+ 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$ )
376
+
377
+ $$
378
+ 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}
379
+ $$
380
+
381
+ 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$
382
+
383
+ 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
384
+
385
+ 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
386
+
387
+ $$
388
+ 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}).
389
+ $$
390
+
391
+ 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.$
392
+
393
+ To bound the number of epochs and prove Lemma 4.3 we follow a blueprint from (Calandriello et al., 2020).
394
+
395
+ 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$ ,
396
+
397
+ $$
398
+ \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}
399
+ $$
400
+
401
+ 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
402
+
403
+ $$
404
+ \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}
405
+ $$
406
+
407
+ 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
408
+
409
+ $$
410
+ \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}.
411
+ $$
412
+
413
+ 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
414
+
415
+ $$
416
+ 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)
417
+ $$
418
+
419
+ ![](images/0baf84e55f2213ffe63a88c52c0ef2236736563ae1281c22be57325c8186436c.jpg)
420
+
421
+ # A.3. Proof of Lemma 4.2
422
+
423
+ 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.
424
+
425
+ # A.4. Proofs of Section 4.3
426
+
427
+ 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).
428
+
429
+ 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
430
+
431
+ $$
432
+ r _ {t _ {j} + 1} \leq G _ {t _ {j}} \sigma_ {t _ {j}} (\mathbf {x} _ {t _ {j} + 1}).
433
+ $$
434
+
435
+ 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
436
+
437
+ $$
438
+ 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}})
439
+ $$
440
+
441
+ Then, leveraging again Corollary A.2 to bound the posterior ratios we obtain
442
+
443
+ $$
444
+ \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}).
445
+ $$
446
+
447
+ Finally, using the fact that $G_{t}$ is non-decreasing, and summing across batches
448
+
449
+ $$
450
+ \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}
451
+ $$
452
+
453
+ Putting it all together and expressing everything in terms of $\gamma_T$ we derive
454
+
455
+ $$
456
+ \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}
457
+ $$
458
+
459
+ 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.
460
+
461
+ <table><tr><td>MINI-GP-UCB</td><td>σ = 455.56, C = 1.1</td></tr><tr><td>MINI-GP-EI</td><td>σ = 455.56, C = 1.1</td></tr><tr><td>BBKB</td><td>σ = 277.78, C = 1.1</td></tr><tr><td>BKB</td><td>σ = 455.56</td></tr><tr><td>GP-UCB</td><td>σ = 500.00</td></tr><tr><td>GP-BUCB</td><td>σ = 455.56, C = 1.1</td></tr><tr><td>ε-GREEDY</td><td>a = 1, b = 0.5</td></tr></table>
462
+
463
+ Table 1: Optimal hyper-parameters found for the NAS-bench experiment.
464
+
465
+ 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
466
+
467
+ $$
468
+ \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}
469
+ $$
470
+
471
+ 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$
472
+
473
+ $$
474
+ \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},
475
+ $$
476
+
477
+ which gives the second half of the theorem.
478
+
479
+ 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.
480
+
481
+ Proof of Theorem 4.6. For this combination our starting point is Equation (38) in (Wang & de Freitas, 2014), which states that for
482
+
483
+ $$
484
+ \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},
485
+ $$
486
+
487
+ running a standard GP-Opt loop (i.e., Algorithm 1) with $u_{t} = u_{t}^{\mathrm{GP - EI}}$ guarantees
488
+
489
+ $$
490
+ r _ {t} \leq \widetilde {\mathcal {O}} \left(\left(\sqrt {F ^ {2} + \gamma_ {t}} + \nu_ {t}\right) \sigma_ {t - 1} (\mathbf {x} _ {t})\right),
491
+ $$
492
+
493
+ 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
494
+
495
+ $$
496
+ 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).
497
+ $$
498
+
499
+ 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.
500
+
501
+ # B. Extended experimental results
502
+
503
+ We report here additional details on the NAS-bench experiments, as well as an evaluation on synthetic functions.
504
+
505
+ ![](images/f9a901e015faecefa983ae2f0ca7be94c78fa722f74d50f0ee81d1ac5c389584.jpg)
506
+
507
+ ![](images/ce3eab896a73f57e351382abfc57660e138bdaab63a4f8935a990c4b7c6dd8e1.jpg)
508
+ (a) Ellipsoid
509
+
510
+ ![](images/b0ae7855a77e451fd746f7f3550fa544b33e9ca92314681ef8ff2eb1714c3d24.jpg)
511
+
512
+ ![](images/cfdcbdcf24492a1b95d671647e0ed941efa193f75b96103174e6af61fae0c3bf.jpg)
513
+ (c) Rosenbrock
514
+ Figure 3: $R_{t} / t$ against step $t$
515
+
516
+ ![](images/74564c7d7e744dda69945055dad6f81d87c657e77cf16227871259b76e421629.jpg)
517
+ (b) Rastigrin
518
+ (d) Schaffer
519
+
520
+ # B.1. Additional details on NAS-bench experiments
521
+
522
+ 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
523
+
524
+ $$
525
+ \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 \}
526
+ $$
527
+
528
+ $$
529
+ C = \{1. 1, 1. 2 \}
530
+ $$
531
+
532
+ 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.
533
+
534
+ # B.2. Evaluation on synthetic functions
535
+
536
+ 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.
537
+
538
+ 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$
539
+
540
+ 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.
541
+
542
+ 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.
543
+
544
+ ![](images/b11a828d74e3e9d9b10d35a9820aade7b141889f860e57522bfd480bdf3574b4.jpg)
545
+
546
+ ![](images/c907922b1faf572870d31ae37af56582bde9fcf72bb9d466f7a844b041e44db0.jpg)
547
+ (a) Ellipsoid
548
+
549
+ ![](images/79a53e1cbc97ed6dfdb024a10a1a48e22455cb418e2ce7277a2c18a4c81554fc.jpg)
550
+
551
+ ![](images/1ca1beed7db0bfd3d01cd1b900aad33fd6486c649de060a44d382ed133fb8d1a.jpg)
552
+ (c) Rosenbrock
553
+ Figure 4: $R_{t} / t$ against time (in seconds)
554
+
555
+ ![](images/6570f4a6090daba56adc78cd212824e91d93a1180dc3cc1eabfe9f817acb7e3e.jpg)
556
+ (b) Rastigrin
557
+ (d) Schaffer
558
+
559
+ # References
560
+
561
+ Elad Hazan, Adam Kalai, Satyen Kale, and Amit Agarwal. Logarithmic regret algorithms for online convex optimization. In Conference on Learning Theory. Springer, 2006.
562
+ Hansen, Nikolaus and Auger, Anne and Finck, Steffen and Ros, Raymond. Real-parameter black-box optimization benchmarking 2010: Experimental setup. INRIA, 2010.
scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea1b83954bd2abca6fa0a3dc96fc4d197f0b11fd95ee3696374a9ba2999a3cdf
3
+ size 764101
scalinggaussianprocessoptimizationbyevaluatingafewuniquecandidatesmultipletimes/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9aa3c5214bcac9a10313f62018d8270574d96ec36388aa9e24220e4764fde45
3
+ size 866558
scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac0ead48447723cacce7af0074babd46028a9df8c7aeae6d723fa37b8a3e8b2a
3
+ size 92908
scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5709870639a55c2fe4b6d7191c1186b870cd1c9720a34af59b3dc0f2ab2c6d7b
3
+ size 111300
scalingoutofdistributiondetectionforrealworldsettings/84e9d134-20f8-483b-b07e-e2271983e142_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ff8c17c557f2c6a18f2088a569c0d8057bcd5914f37587148e1cb0f143980cc
3
+ size 12147194
scalingoutofdistributiondetectionforrealworldsettings/full.md ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Scaling Out-of-Distribution Detection for Real-World Settings
2
+
3
+ Dan Hendrycks $^{*1}$ Steven Basart $^{*2}$ Mantas Mazeika $^{3}$ Andy Zou $^{1}$ Joe Kwon $^{4}$ Mohammadreza Mostajabi $^{5}$ Jacob Steinhardt $^{1}$ Dawn Song $^{1}$
4
+
5
+ # Abstract
6
+
7
+ 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.
8
+
9
+ # 1. Introduction
10
+
11
+ 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
12
+
13
+ *Equal contribution ¹UC Berkeley ²UChicago ³UIUC ⁴Yale University ⁵TTIC. Correspondence to: Dan Hendrycks <hendrycks@berkeley.edu>.
14
+
15
+ Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s).
16
+
17
+ 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.
18
+
19
+ 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.
20
+
21
+ 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
22
+
23
+ ![](images/20c96006463ffc7be6acf0833004954b1f1d36780120c07b8324334ca84b7753.jpg)
24
+ Large Scale Multiclass
25
+
26
+ ![](images/74286ac2166c2050de910d14034f04cfcc8dc335f9b4af88bee5943082e5c0d5.jpg)
27
+ Large Scale Segmentation
28
+
29
+ ![](images/5573753cb2058bb3734bd0deccf9a7bb7005e3dbd12fe041d41f31ff40f91c1f.jpg)
30
+ 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.
31
+
32
+ ![](images/202fa670e07513d4fb9bc9f5adc25839d936a72b733d4c0da93402eba173effe.jpg)
33
+
34
+ large-scale multi-class setting generalizes well to multi-label data and again outperforms all other baselines.
35
+
36
+ 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).
37
+
38
+ 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.
39
+
40
+ 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
41
+
42
+ 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.
43
+
44
+ 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.
45
+
46
+ # 2. Related Work
47
+
48
+ 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
49
+
50
+ # Anomalous Species Dataset
51
+
52
+ ![](images/4540ae475ff7293a98d91b965828c6c02f7a2c0670a4be71bd79a1eac830df85.jpg)
53
+ 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.
54
+
55
+ 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.
56
+
57
+ 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).
58
+
59
+ 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;
60
+
61
+ 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.
62
+
63
+ 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.
64
+
65
+ 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-
66
+
67
+ Scaling Out-of-Distribution Detection for Real-World Settings
68
+
69
+ <table><tr><td rowspan="2">Din</td><td colspan="3">FPR95 ↓</td><td colspan="3">AUROC ↑</td><td colspan="3">AUPR ↑</td></tr><tr><td>MSP</td><td>DeVries</td><td>MaxLogit</td><td>MSP</td><td>DeVries</td><td>MaxLogit</td><td>MSP</td><td>DeVries</td><td>MaxLogit</td></tr><tr><td>ImageNet</td><td>44.2</td><td>46.0</td><td>35.8</td><td>84.6</td><td>76.9</td><td>87.2</td><td>38.2</td><td>30.5</td><td>45.8</td></tr><tr><td>Places365</td><td>52.6</td><td>85.8</td><td>36.6</td><td>76.0</td><td>31.1</td><td>85.8</td><td>8.2</td><td>2.0</td><td>19.2</td></tr></table>
70
+
71
+ 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.
72
+
73
+ vandić et al. (2018) use ILSVRC 2012 images and train their network to segment the entirety of these images as out-of-distribution.
74
+
75
+ ![](images/388a328f7eabc5134d89e8a522f7e06460369d69f14dc57efe92b9815b999642.jpg)
76
+
77
+ ![](images/46c8f8aa0d793df686659032079cd0f3e64cc244708bc8d870022a3c5fb31366.jpg)
78
+ 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.
79
+
80
+ In medical anomaly segmentation and product fault detec
81
+
82
+ 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.
83
+
84
+ 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.
85
+
86
+ 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-
87
+
88
+ Scaling Out-of-Distribution Detection for Real-World Settings
89
+
90
+ <table><tr><td rowspan="2">Din</td><td rowspan="2">TestDout</td><td colspan="2">ResNet</td><td colspan="2">ViT</td><td colspan="2">MLP Mixer</td></tr><tr><td>MSP</td><td>MaxLogit</td><td>MSP</td><td>MaxLogit</td><td>MSP</td><td>MaxLogit</td></tr><tr><td rowspan="10">ImageNet-21K-P</td><td>Amphibians</td><td>40.1</td><td>48.3</td><td>41.3</td><td>49.0</td><td>42.7</td><td>50.1</td></tr><tr><td>Arachnids</td><td>45.6</td><td>54.6</td><td>44.8</td><td>55.0</td><td>47.1</td><td>57.2</td></tr><tr><td>Fish</td><td>40.6</td><td>55.5</td><td>41.2</td><td>53.6</td><td>41.8</td><td>53.4</td></tr><tr><td>Fungi</td><td>66.0</td><td>76.8</td><td>63.9</td><td>76.1</td><td>63.7</td><td>76.4</td></tr><tr><td>Insects</td><td>46.8</td><td>54.9</td><td>47.6</td><td>52.8</td><td>47.8</td><td>52.1</td></tr><tr><td>Mammals</td><td>45.0</td><td>50.0</td><td>47.6</td><td>47.5</td><td>48.1</td><td>46.3</td></tr><tr><td>Microorganisms</td><td>76.3</td><td>82.4</td><td>69.3</td><td>81.0</td><td>72.7</td><td>84.9</td></tr><tr><td>Mollusks</td><td>44.5</td><td>51.9</td><td>43.4</td><td>49.8</td><td>44.8</td><td>51.6</td></tr><tr><td>Plants</td><td>68.4</td><td>75.8</td><td>65.7</td><td>72.9</td><td>67.2</td><td>73.9</td></tr><tr><td>Protozoa</td><td>72.9</td><td>81.6</td><td>71.8</td><td>81.8</td><td>71.2</td><td>79.1</td></tr><tr><td colspan="2">Mean</td><td>54.6</td><td>63.2</td><td>53.7</td><td>61.9</td><td>54.7</td><td>62.5</td></tr></table>
91
+
92
+ 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.
93
+
94
+ 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.
95
+
96
+ # 3. Multi-Class Prediction for OOD Detection
97
+
98
+ 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
99
+
100
+ the number of classes and can serve as a better baseline for large-scale out-of-distribution detection.
101
+
102
+ 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.
103
+
104
+ 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.
105
+
106
+ Scaling Out-of-Distribution Detection for Real-World Settings
107
+
108
+ <table><tr><td></td><td></td><td>iForest</td><td>LOF</td><td>Dropout</td><td>LogitAvg</td><td>MSP</td><td>MaxLogit</td></tr><tr><td rowspan="3">PASCAL VOC</td><td>FPR95 ↓</td><td>98.6</td><td>84.0</td><td>97.2</td><td>98.2</td><td>82.3</td><td>35.6</td></tr><tr><td>AUROC ↑</td><td>46.3</td><td>68.4</td><td>49.2</td><td>47.9</td><td>74.2</td><td>90.9</td></tr><tr><td>AUPR ↑</td><td>37.1</td><td>58.4</td><td>45.3</td><td>41.3</td><td>65.5</td><td>81.2</td></tr><tr><td rowspan="3">COCO</td><td>FPR95 ↓</td><td>95.6</td><td>78.4</td><td>93.3</td><td>94.5</td><td>81.8</td><td>40.4</td></tr><tr><td>AUROC ↑</td><td>41.4</td><td>70.2</td><td>58.0</td><td>55.5</td><td>70.7</td><td>90.3</td></tr><tr><td>AUPR ↑</td><td>63.7</td><td>82.0</td><td>76.3</td><td>74.0</td><td>82.9</td><td>94.0</td></tr></table>
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ 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.
115
+
116
+ 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.
117
+
118
+ # 4. Multi-Label Prediction for OOD Detection
119
+
120
+ 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.
121
+
122
+ Setup. We use PASCAL VOC (Everingham et al., 2009) and MS-COCO (Lin et al., 2014) as in-distribution data. To
123
+
124
+ 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.
125
+
126
+ 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.
127
+
128
+ 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}$ .
129
+
130
+ 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.
131
+
132
+ # 5. The CAOS Benchmark
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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
139
+
140
+ ![](images/5c415cc613e44b9cbd14ad5d58af52151c34ed5f9ac5947bfb3f4e90761541a5.jpg)
141
+ 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.
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ Scaling Out-of-Distribution Detection for Real-World Settings
148
+
149
+ <table><tr><td></td><td></td><td>MSP</td><td>Branch</td><td>Background</td><td>Dropout</td><td>AE</td><td>MaxLogit</td></tr><tr><td rowspan="3">StreetHazards</td><td>FPR95 ↓</td><td>33.7</td><td>68.4</td><td>69.0</td><td>79.4</td><td>91.7</td><td>26.5</td></tr><tr><td>AUROC ↑</td><td>87.7</td><td>65.7</td><td>58.6</td><td>69.9</td><td>66.1</td><td>89.3</td></tr><tr><td>AUPR ↑</td><td>6.6</td><td>1.5</td><td>4.5</td><td>7.5</td><td>2.2</td><td>10.6</td></tr><tr><td rowspan="3">BDD-Anomaly</td><td>FPR95 ↓</td><td>24.5</td><td>25.6</td><td>40.1</td><td>16.6</td><td>74.1</td><td>14.0</td></tr><tr><td>AUROC ↑</td><td>87.7</td><td>85.6</td><td>69.7</td><td>90.8</td><td>64.0</td><td>92.6</td></tr><tr><td>AUPR ↑</td><td>3.7</td><td>3.9</td><td>1.1</td><td>4.3</td><td>0.7</td><td>5.4</td></tr></table>
150
+
151
+ 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.
152
+
153
+ # 5.1. Experiments
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ 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.
160
+
161
+ 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
162
+
163
+ 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).
164
+
165
+ 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.
166
+
167
+ # 6. Conclusion
168
+
169
+ 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.
170
+
171
+ # References
172
+
173
+ Angus, M. Towards pixel-level ood detection for semantic segmentation, 2019.
174
+ 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.
175
+ Bevandić, P., Krešo, I., Oršić, M., and Šegvic, S. Discriminative out-of-distribution detection for semantic segmentation, 2018.
176
+ Blum, H., Sarlin, P.-E., Nieto, J., Siegwart, R., and Cadena, C. The fishyscapes benchmark: Measuring blind spots in semantic segmentation, 2019.
177
+ 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.
178
+ Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and Vedaldi, A. Describing textures in the wild. In Computer Vision and Pattern Recognition, 2014.
179
+ 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.
180
+ 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.
181
+ DeVries, T. and Taylor, G. W. Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018.
182
+ 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.
183
+ 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.
184
+ 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.
185
+
186
+ Emmott, A., Das, S., Dietterich, T., Fern, A., and Wong, W.-K. A meta-analysis of the anomaly detection problem, 2015.
187
+ 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.
188
+ Fort, S., Ren, J., and Lakshminarayanan, B. Exploring the limits of out-of-distribution detection. NeurIPS, 2021.
189
+ Gal, Y. and Ghahramani, Z. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. International Conference on Machine Learning, 2016.
190
+ 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.
191
+ He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. CVPR, 2015.
192
+ 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.
193
+ Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
194
+ Hendrycks, D. and Gimpel, K. A baseline for detecting misclassified and out-of-distribution examples in neural networks. *ICLR*, 2017.
195
+ Hendrycks, D., Mazeika, M., and Dietterich, T. Deep anomaly detection with outlier exposure. Proceedings of the International Conference on Learning Representations, 2019a.
196
+ Hendrycks, D., Mazeika, M., and Dietterich, T. Deep anomaly detection with outlier exposure. In International Conference on Learning Representations, 2019b.
197
+ Hendrycks, D., Mazeika, M., Kadavath, S., and Song, D. Using self-supervised learning can improve model robustness and uncertainty. In NeurIPS, 2019c.
198
+ Hendrycks, D., Carlini, N., Schulman, J., and Steinhardt, J. Unsolved problems in ml safety. *ArXiv*, abs/2109.13916, 2021.
199
+
200
+ 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.
201
+ 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.
202
+ 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.
203
+ Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. *ICLR*, 2014.
204
+ Koner, R., Sinhamahapatra, P., Roscher, K., Gunnemann, S., and Tresp, V. Oodformer: Out-of-distribution detection transformer. ArXiv, 2021.
205
+ Krešo, I., Oršić, M., Bevandić, P., and Šegvic, S. Robust semantic segmentation with ladder-densenet models, 2018.
206
+ 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.
207
+ 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.
208
+ 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.
209
+ 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.
210
+ 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.
211
+ 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.
212
+ Mohseni, S., Pitale, M., Yadawa, J., and Wang, Z. Self-supervised learning for generalizable out-of-distribution detection. In AAAI, 2020.
213
+
214
+ 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.
215
+ Ridnik, T., Ben-Baruch, E., Noy, A., and Zelnik-Manor, L. Imagenet-21k pretraining for the masses. *ArXiv*, abs/2104.10972, 2021a.
216
+ 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.
217
+ 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.
218
+ 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.
219
+ 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.
220
+ 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.
221
+ 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.
222
+ 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.
223
+ 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.
224
+ 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.
225
+
226
+ 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.
227
+ Zhou, B., Lapedriza, A., Khosla, A., Oliva, A., and Torralba, A. Places: A 10 million image database for scene recognition. PAMI, 2017.
228
+ 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.
229
+
230
+ # A. Full Multiclass OOD Detection Results
231
+
232
+ 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.
233
+
234
+ 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.
235
+
236
+ 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.
237
+
238
+ 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
239
+
240
+ Scaling Out-of-Distribution Detection for Real-World Settings
241
+
242
+ <table><tr><td rowspan="2">Din</td><td rowspan="2">Dtestout</td><td colspan="4">FPR95 ↓</td><td colspan="4">AUROC ↑</td><td colspan="4">AUPR ↑</td></tr><tr><td>B</td><td>M</td><td>D</td><td>K</td><td>B</td><td>M</td><td>D</td><td>K</td><td>B</td><td>M</td><td>D</td><td>K</td></tr><tr><td rowspan="6">ImageNet</td><td>Gaussian</td><td>2</td><td>0</td><td>5</td><td>4</td><td>100</td><td>100</td><td>97</td><td>98</td><td>93</td><td>98</td><td>55</td><td>79</td></tr><tr><td>Rademacher</td><td>21</td><td>4</td><td>4</td><td>15</td><td>89</td><td>98</td><td>98</td><td>93</td><td>29</td><td>70</td><td>62</td><td>54</td></tr><tr><td>Blobs</td><td>26</td><td>32</td><td>72</td><td>8</td><td>80</td><td>79</td><td>37</td><td>99</td><td>25</td><td>17</td><td>7</td><td>93</td></tr><tr><td>Textures</td><td>68</td><td>56</td><td>74</td><td>59</td><td>80</td><td>87</td><td>76</td><td>85</td><td>25</td><td>36</td><td>16</td><td>48</td></tr><tr><td>LSUN</td><td>66</td><td>63</td><td>59</td><td>60</td><td>75</td><td>77</td><td>76</td><td>79</td><td>21</td><td>22</td><td>19</td><td>38</td></tr><tr><td>Places365</td><td>64</td><td>59</td><td>63</td><td>72</td><td>79</td><td>83</td><td>79</td><td>79</td><td>27</td><td>32</td><td>24</td><td>46</td></tr><tr><td rowspan="6">Places365</td><td>Mean</td><td>41.3</td><td>35.8</td><td>46</td><td>36.1</td><td>85.2</td><td>87.2</td><td>76.9</td><td>88.7</td><td>37</td><td>45.8</td><td>30.5</td><td>59.7</td></tr><tr><td>Gaussian</td><td>10</td><td>6</td><td>71</td><td>12</td><td>93</td><td>96</td><td>35</td><td>93</td><td>16</td><td>24</td><td>2</td><td>16</td></tr><tr><td>Rademacher</td><td>20</td><td>10</td><td>91</td><td>1</td><td>89</td><td>93</td><td>10</td><td>100</td><td>11</td><td>15.9</td><td>1.6</td><td>88</td></tr><tr><td>Blobs</td><td>59</td><td>6</td><td>88</td><td>27</td><td>72</td><td>98</td><td>15</td><td>93</td><td>5</td><td>41</td><td>2</td><td>31</td></tr><tr><td>Textures</td><td>86</td><td>72</td><td>87</td><td>74</td><td>65</td><td>79</td><td>43</td><td>79</td><td>4</td><td>11</td><td>1</td><td>12</td></tr><tr><td>Places69</td><td>88</td><td>89</td><td>92</td><td>91</td><td>61</td><td>64</td><td>52</td><td>65</td><td>5</td><td>6</td><td>3</td><td>6</td></tr><tr><td colspan="2">Mean</td><td>53</td><td>36.6</td><td>85.8</td><td>40.9</td><td>76</td><td>85.8</td><td>31.1</td><td>85.8</td><td>8</td><td>19.2</td><td>2</td><td>30.5</td></tr></table>
243
+
244
+ 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.
245
+
246
+ 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.
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ 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
255
+
256
+ ![](images/643be207c847e4b22afb194a6e01cacab92d6d851a8fb3fe37a98cb57a8d5c47.jpg)
257
+ 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.
258
+
259
+ <table><tr><td></td><td></td><td>MSP</td><td>MaxLogit</td></tr><tr><td rowspan="3">FS Lost and Found</td><td>FPR95 ↓</td><td>45.6</td><td>18.8</td></tr><tr><td>AUROC ↑</td><td>87.0</td><td>92.0</td></tr><tr><td>AUPR ↑</td><td>6.0</td><td>38.1</td></tr><tr><td rowspan="3">Road Anomaly</td><td>FPR95 ↓</td><td>68.4</td><td>64.9</td></tr><tr><td>AUROC ↑</td><td>73.8</td><td>78.0</td></tr><tr><td>AUPR ↑</td><td>20.6</td><td>24.4</td></tr></table>
260
+
261
+ 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.
262
+
263
+ 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.
264
+
265
+ # B. OOD Segmentation
266
+
267
+ 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
268
+
269
+ 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.
270
+
271
+ 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.
272
+
273
+ $$
274
+ b \sim B (0. 5)
275
+ $$
276
+
277
+ $$
278
+ c := \hat {c} \cdot b + (1 - b)
279
+ $$
280
+
281
+ $$
282
+ P := P \cdot c + (1 - c) y
283
+ $$
284
+
285
+ 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:
286
+
287
+ ![](images/041a502ff166e4c75a60e04e8b83458e0c098fc674f2c6cb655211ac92b879be.jpg)
288
+ 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.
289
+
290
+ $$
291
+ \mathcal {L} _ {p} = \frac {1}{| P |} \sum_ {i} - \log (p _ {i}) y _ {i}
292
+ $$
293
+
294
+ $$
295
+ \mathcal {L} _ {c} = \frac {1}{| P |} \sum_ {i} - \log (\hat {c} _ {i})
296
+ $$
297
+
298
+ $$
299
+ \mathcal {L} = \mathcal {L} _ {p} + \lambda \mathcal {L} _ {c}
300
+ $$
301
+
302
+ 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:
303
+
304
+ $$
305
+ \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.
306
+ $$
307
+
308
+ This adaptively adjusts the weighting between the two losses and experimentally the update is not sensitive to the budget parameter.
309
+
310
+ 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.
311
+
312
+ 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.
313
+
314
+ 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
315
+
316
+ 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.
317
+
318
+ # C. Species
319
+
320
+ 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.
321
+
322
+ 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.
323
+
324
+ <table><tr><td>Supercategory</td><td># Classes</td><td># Images</td></tr><tr><td>Amphibians</td><td>79</td><td>31,411</td></tr><tr><td>Arachnids</td><td>48</td><td>11,575</td></tr><tr><td>Fish</td><td>208</td><td>111,377</td></tr><tr><td>Fungi</td><td>202</td><td>163,049</td></tr><tr><td>Insects</td><td>189</td><td>116,635</td></tr><tr><td>Mammals</td><td>96</td><td>24,244</td></tr><tr><td>Microorganisms</td><td>61</td><td>1,462</td></tr><tr><td>Mollusks</td><td>211</td><td>119,465</td></tr><tr><td>Plants</td><td>176</td><td>120,089</td></tr><tr><td>Protozoa</td><td>46</td><td>15,072</td></tr><tr><td>Total</td><td>1,316</td><td>714,379</td></tr></table>
325
+
326
+ Table 7: Overview of the Species dataset.
scalingoutofdistributiondetectionforrealworldsettings/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7b963891ee65a40c38e89990b71b74cf15462b2bc218544b6522fe52cfaed22
3
+ size 865406
scalingoutofdistributiondetectionforrealworldsettings/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc7882ee66b31ae187ffd30dcfd8f57d8f83d5dab0c7e0566fec425f46054b4a
3
+ size 389881
scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8ec55f8443ba134c1014e92e28e6af6d1da1f1ecf377af5db865f249dd97967
3
+ size 138320
scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1c69d61d4a93bfea0e648d4223985ba5088fbb2e5f06ef3271f93d404a06a9e
3
+ size 161047
scalingstructuredinferencewithrandomization/5b20c086-adaf-4b1f-ba5d-0b35a8a12698_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccb645c29281e20ab0960b1e5ef49d854fdb3850c997f71b483502ab49246889
3
+ size 1409140
scalingstructuredinferencewithrandomization/full.md ADDED
@@ -0,0 +1,738 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Yao Fu<sup>1</sup> John P. Cunningham<sup>2,3</sup> Mirella Lapata<sup>1</sup>
2
+
3
+ # Abstract
4
+
5
+ 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.
6
+
7
+ # 1. Introduction
8
+
9
+ Deep discrete structured models (Martins et al., 2019; Rush, 2020) have enjoyed great progress recently, improving per
10
+
11
+ $^{1}$ School of Informatics, University of Edinburgh $^{2}$ Statistics Department, Columbia University $^{3}$ Zuckerman Institute, Columbia University. Correspondence to: Yao Fu <yao.fu@ed.ac.uk>, John P. Cunningham <jpc2181@columbia.edu>, Mirella Lapata <mlxap@inf.ed.ac.uk>.
12
+
13
+ Proceedings of the $39^{th}$ International Conference on Machine Learning, Baltimore, Maryland, USA, PMLR 162, 2022. Copyright 2022 by the author(s).
14
+
15
+ 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.
16
+
17
+ 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).
18
+
19
+ 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
20
+
21
+ 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.
22
+
23
+ <table><tr><td>Graph</td><td>Model</td><td>Partition &amp; Marginal</td><td>Entropy</td><td>Sampling &amp; Reparameterization</td></tr><tr><td>Chains</td><td>HMM, CRF, Semi-Markov</td><td>Forward-Backward</td><td>Backward Entropy</td><td>Gumbel Sampling (Fu et al., 2020)</td></tr><tr><td>Hypertrees</td><td>PCFG, Dependency CRF</td><td>Inside-Outside</td><td>Outside Entropy</td><td>Stochastic Softmax (Paulus et al., 2020)</td></tr><tr><td>General graph</td><td>General Exponential Family</td><td>Sum-Product</td><td>Bethe Entropy</td><td>Stochastic Softmax (Paulus et al., 2020)</td></tr></table>
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ # 2. Background and Preliminaries
30
+
31
+ 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:
32
+
33
+ $$
34
+ \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}
35
+ $$
36
+
37
+ 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
38
+
39
+ goal is to learn this model with a scaled latent space (e.g., a CRF encoder with tens of thousands of latent states).
40
+
41
+ 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):
42
+
43
+ $$
44
+ 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}
45
+ $$
46
+
47
+ 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:
48
+
49
+ $$
50
+ \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}
51
+ $$
52
+
53
+ 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.
54
+
55
+ 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
56
+
57
+ states, it would induce memory overflow if we wanted to scale it to tens of thousands.
58
+
59
+ 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 computations<sup>1</sup> 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.
60
+
61
+ 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).
62
+
63
+ 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.
64
+
65
+ <sup>1</sup>More 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.
66
+
67
+ 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:
68
+
69
+ $$
70
+ \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}
71
+ $$
72
+
73
+ 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.
74
+
75
+ # 3. Scaling Inference with Randomization
76
+
77
+ 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
78
+
79
+ ![](images/0a8075e21639a0a64a3995fc4910238ff78f0681eabac7f6f33ec2736ac5714a.jpg)
80
+ 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.
81
+
82
+ 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.
83
+
84
+ # 3.1. Framework: Randomized Sum-Product
85
+
86
+ 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}$ :
87
+
88
+ $$
89
+ \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}
90
+ $$
91
+
92
+ $$
93
+ \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}
94
+ $$
95
+
96
+ $$
97
+ \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}
98
+ $$
99
+
100
+ Then, we substitute the full index $\{1,\dots,N\}$ with the top $\Omega_t^{K_1}$ and the sampled index $\Omega_t^{K_2}$ :
101
+
102
+ $$
103
+ \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}
104
+ $$
105
+
106
+ 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.
107
+
108
+ 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
109
+
110
+ $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):
111
+
112
+ $$
113
+ \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}
114
+ $$
115
+
116
+ 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}$ :
117
+
118
+ $$
119
+ 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}
120
+ $$
121
+
122
+ $$
123
+ 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}
124
+ $$
125
+
126
+ The conditional expectation $\hat{S} (\delta_2) = \mathbb{E}[S(\delta_1,\delta_2)|\delta_2]$ is:
127
+
128
+ $$
129
+ \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}
130
+ $$
131
+
132
+ 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:
133
+
134
+ $$
135
+ \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}
136
+ $$
137
+
138
+ 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
139
+
140
+ # Algorithm 1 Randomized Forward
141
+
142
+ 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}$
143
+
144
+ Initialize $\alpha_{1}(i) = \phi (x_{0} = \emptyset ,x_{1} = i,y_{t})$
145
+
146
+ For $t = 2$ to $T$ , compute recursion:
147
+
148
+ $$
149
+ \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}
150
+ $$
151
+
152
+ 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$
153
+
154
+ index $\delta_{2}$ to $K_{2}$ will recover our full message estimator in Eq. 8.
155
+
156
+ # 3.2. First-Order Randomized DP
157
+
158
+ 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.
159
+
160
+ # 3.2.1. RANDOMIZED FORWARD
161
+
162
+ 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.
163
+
164
+ 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
165
+
166
+ # Algorithm 2 Randomized Inside
167
+
168
+ 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}$
169
+
170
+ Initialize $\alpha (i,i,k) = \phi (i,i,k)$
171
+
172
+ For $l = 1$ to $T - 1$ , let $j = i + l$ , compute recursion:
173
+
174
+ $$
175
+ \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}
176
+ $$
177
+
178
+ Return $\hat{Z} = \sum_{\sigma \in \Omega_{1,T}^{K_1}}\hat{\alpha} (1,T,\sigma) +$
179
+
180
+ $$
181
+ \sum_ {\delta \in \Omega_ {1, T} ^ {K _ {2}}} \frac {1}{K _ {2} q _ {T} (\delta)} \hat {\alpha} (1, T, \delta)
182
+ $$
183
+
184
+ and $\{\hat{\alpha}_{i,j}\} ,i,j\in \{1,\dots,T\}$
185
+
186
+ 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).
187
+
188
+ 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).
189
+
190
+ # 3.2.2. RANDOMIZED INSIDE
191
+
192
+ 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.
193
+
194
+ # Algorithm 3 Randomized Entropy DP
195
+
196
+ 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}$
197
+
198
+ Initialize $H_{1}(i) = 0$ ; call Randomized Forward to get $\hat{Z}, \hat{\alpha}$
199
+
200
+ For $t = 1$ to $T - 1$ , compute recursion:
201
+
202
+ $$
203
+ \hat {p} _ {t} (i, j) = \phi (i, j, x _ {t}) \hat {\alpha} _ {t} (i) / \hat {\alpha} _ {t + 1} (j) \tag {19}
204
+ $$
205
+
206
+ $$
207
+ \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) ] +
208
+ $$
209
+
210
+ $$
211
+ \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}
212
+ $$
213
+
214
+ Return $\hat{H}$ where:
215
+
216
+ $$
217
+ \hat {p} _ {T} (i) = \hat {\alpha} _ {T} (i) / \hat {Z} \tag {21}
218
+ $$
219
+
220
+ $$
221
+ \hat {H} = \sum_ {\sigma \in \Omega_ {T} ^ {K _ {1}}} \hat {p} _ {T} (\sigma) [ \hat {H} _ {T} (\sigma) - \log \hat {p} _ {T} (\sigma) ] +
222
+ $$
223
+
224
+ $$
225
+ \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}
226
+ $$
227
+
228
+ 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.
229
+
230
+ # 3.3. Second-Order Randomized DP
231
+
232
+ 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.
233
+
234
+ # 3.3.1. RANDOMIZED ENTROPY DP
235
+
236
+ 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
237
+
238
+ # Algorithm 4 Randomized Gumbel Backward Sampling
239
+
240
+ 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)
241
+
242
+ Initialize: call Randomized Forward to get $\hat{Z},\hat{\alpha}$ ,then:
243
+
244
+ $$
245
+ \hat {p} _ {T} (i) = \hat {\alpha} _ {T} (i) / \hat {Z}, \quad i \in \Omega_ {T} ^ {K _ {1}} \cup \Omega_ {T} ^ {K _ {2}} \tag {23}
246
+ $$
247
+
248
+ $$
249
+ \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}
250
+ $$
251
+
252
+ $$
253
+ \hat {x} _ {T} = \operatorname {a r g m a x} _ {i} \tilde {\boldsymbol {x}} _ {T} (i) \tag {25}
254
+ $$
255
+
256
+ For $t = T - 1$ to 1, compute recursion:
257
+
258
+ $$
259
+ \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}
260
+ $$
261
+
262
+ $$
263
+ \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}
264
+ $$
265
+
266
+ $$
267
+ \hat {x} _ {t} = \operatorname {a r g m a x} _ {i} \tilde {\boldsymbol {x}} _ {t} (i) \tag {28}
268
+ $$
269
+
270
+ Return relaxed sample $\{\tilde{x}_t\}_{t = 1}^T$ , hard sample $\{\hat{x}_t\}_{t = 1}^T$
271
+
272
+ 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.
273
+
274
+ # 3.3.2. RANDOMIZED GUMBEL BACKWARD SAMPLING
275
+
276
+ 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.
277
+
278
+ # 4. Scaling Structured VAE with RDP
279
+
280
+ 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.
281
+
282
+ 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.
283
+
284
+ <table><tr><td rowspan="2">N=2000</td><td colspan="3">Linear-chain log Z</td><td colspan="3">Hypertree log Z</td><td colspan="3">Linear-chain Entropy</td></tr><tr><td>D</td><td>I</td><td>L</td><td>D</td><td>I</td><td>L</td><td>D</td><td>I</td><td>L</td></tr><tr><td>TopK 20%N</td><td>3.874</td><td>1.015</td><td>0.162</td><td>36.127</td><td>27.435</td><td>21.78</td><td>443.7</td><td>84.35</td><td>8.011</td></tr><tr><td>TopK 50%N</td><td>0.990</td><td>0.251</td><td>0.031</td><td>2.842</td><td>2.404</td><td>2.047</td><td>131.8</td><td>22.100</td><td>1.816</td></tr><tr><td>RDP 1%N (ours)</td><td>0.146</td><td>0.066</td><td>0.076</td><td>26.331</td><td>37.669</td><td>48.863</td><td>5.925</td><td>1.989</td><td>0.691</td></tr><tr><td>RDP 10%N (ours)</td><td>0.067</td><td>0.033</td><td>0.055</td><td>1.193</td><td>1.530</td><td>1.384</td><td>2.116</td><td>1.298</td><td>0.316</td></tr><tr><td>RDP 20%N (ours)</td><td>0.046</td><td>0.020</td><td>0.026</td><td>0.445</td><td>0.544</td><td>0.599</td><td>1.326</td><td>0.730</td><td>0.207</td></tr><tr><td>N=10000</td><td>D</td><td>I</td><td>L</td><td>D</td><td>I</td><td>L</td><td>D</td><td>I</td><td>L</td></tr><tr><td>TopK 20%N</td><td>6.395</td><td>6.995</td><td>6.381</td><td>78.632</td><td>63.762</td><td>43.556</td><td>227.36</td><td>171.97</td><td>141.91</td></tr><tr><td>TopK 50%N</td><td>2.134</td><td>2.013</td><td>1.647</td><td>35.929</td><td>26.677</td><td>17.099</td><td>85.063</td><td>59.877</td><td>46.853</td></tr><tr><td>RDP 1%N (ours)</td><td>0.078</td><td>0.616</td><td>0.734</td><td>3.376</td><td>5.012</td><td>7.256</td><td>6.450</td><td>6.379</td><td>4.150</td></tr><tr><td>RDP 10%N (ours)</td><td>0.024</td><td>0.031</td><td>0.024</td><td>0.299</td><td>0.447</td><td>0.576</td><td>0.513</td><td>1.539</td><td>0.275</td></tr><tr><td>RDP 20%N (ours)</td><td>0.004</td><td>0.003</td><td>0.003</td><td>0.148</td><td>0.246</td><td>0.294</td><td>0.144</td><td>0.080</td><td>0.068</td></tr></table>
285
+
286
+ Table 3. Bias-Variance decomposition of Randomized Forward.
287
+
288
+ <table><tr><td></td><td colspan="2">Dense</td><td colspan="2">Long-tail</td></tr><tr><td></td><td>Bias</td><td>Var.</td><td>Bias</td><td>Var.</td></tr><tr><td>TOPK 20%N</td><td>-1.968</td><td>0</td><td>-0.403</td><td>0</td></tr><tr><td>TOPK 50%N</td><td>-0.995</td><td>0</td><td>-0.177</td><td>0</td></tr><tr><td>RDP 1%N (ours)</td><td>-0.066</td><td>0.141</td><td>-0.050</td><td>0.074</td></tr><tr><td>RDP 10%N (ours)</td><td>-0.030</td><td>0.066</td><td>-0.027</td><td>0.054</td></tr><tr><td>RDP 20%N (ours)</td><td>-0.013</td><td>0.046</td><td>-0.003</td><td>0.026</td></tr></table>
289
+
290
+ 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:
291
+
292
+ $$
293
+ 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)
294
+ $$
295
+
296
+ $$
297
+ 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})))
298
+ $$
299
+
300
+ $$
301
+ 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)))
302
+ $$
303
+
304
+ Inference Model Since the posterior is intractable, we use a structured inference model parameterized by a CRF with a neural encoder:
305
+
306
+ $$
307
+ 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}
308
+ $$
309
+
310
+ 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:
311
+
312
+ $$
313
+ [ \boldsymbol {r} _ {1}, \dots , \boldsymbol {r} _ {T} ] = \operatorname {E n c} (y _ {1}, \dots , y _ {t}) \tag {30}
314
+ $$
315
+
316
+ Table 4. Proposal effect on Randomized Forward.
317
+
318
+ <table><tr><td></td><td>Dense</td><td>Interm.</td><td>Long-tail</td></tr><tr><td>UNIFORM</td><td>0.655</td><td>11.05</td><td>0.160</td></tr><tr><td>LOCAL</td><td>2.908</td><td>9.171</td><td>0.481</td></tr><tr><td>GLOBAL</td><td>0.453</td><td>0.096</td><td>0.100</td></tr><tr><td>LOCAL + GLOBAL</td><td>0.028</td><td>0.017</td><td>0.022</td></tr></table>
319
+
320
+ 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:
321
+
322
+ $$
323
+ \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}
324
+ $$
325
+
326
+ Training uses the following format of ELBO:
327
+
328
+ $$
329
+ \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}
330
+ $$
331
+
332
+ 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:
333
+
334
+ $$
335
+ \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}
336
+ $$
337
+
338
+ 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.
339
+
340
+ Proposal Construction we consider the following:
341
+
342
+ $$
343
+ 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}
344
+ $$
345
+
346
+ 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
347
+
348
+ ![](images/41e6627d64c4fa790d222071b3940bb9de8ec511b0b98d9e47f374f74cebc085.jpg)
349
+ 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.
350
+
351
+ 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.
352
+
353
+ 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.
354
+
355
+ # 5. Experiments
356
+
357
+ 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.
358
+
359
+ # 5.1. Evaluation of RDP Algorithms
360
+
361
+ 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.
362
+
363
+ Comparison Models Since there is only a handful of methods that apply to this range of structures and inference,
364
+
365
+ Table 5. Negative Log Likelihood comparison.
366
+
367
+ <table><tr><td></td><td>Dev NLL</td><td>Test NLL</td></tr><tr><td>FULL-100</td><td>39.64 ± 0.06</td><td>39.71 ± 0.07</td></tr><tr><td>TOPK-100</td><td>39.71 ± 0.13</td><td>39.76 ± 0.11</td></tr><tr><td>RDP-100 (ours)</td><td>39.59 ± 0.10</td><td>39.59 ± 0.08</td></tr><tr><td>TOPK-2000 (ours)</td><td>39.81 ± 0.30</td><td>39.84 ± 0.31</td></tr><tr><td>RDP-2000 (ours)</td><td>39.47 ± 0.11</td><td>39.48 ± 0.14</td></tr></table>
368
+
369
+ 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.
370
+
371
+ 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.
372
+
373
+ 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
374
+
375
+ 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.
376
+
377
+ # 5.2. Evaluation of the Structured VAE
378
+
379
+ 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.
380
+
381
+ 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).
382
+
383
+ 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).
384
+
385
+ # 6. Conclusion
386
+
387
+ 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-
388
+
389
+ 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.
390
+
391
+ # Acknowledgements
392
+
393
+ 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.
394
+
395
+ # References
396
+
397
+ 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.
398
+ 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.
399
+ 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.
400
+ 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.
401
+ 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.
402
+
403
+ 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.
404
+ 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.
405
+ Corro, C. and Titov, I. Differentiable perturb-and-parse: Semi-supervised parsing with a structured variational autoencoder. arXiv preprint arXiv:1807.09875, 2018.
406
+ 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.
407
+ Fu, Y., Tan, C., Bi, B., Chen, M., Feng, Y., and Rush, A. M. Latent template induction with gumbel-crf. In NeurIPS, 2020.
408
+ 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.
409
+ 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.
410
+ 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.
411
+ 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.
412
+ 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.
413
+
414
+ 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.
415
+ 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.
416
+ 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.
417
+ 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.
418
+ 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.
419
+ 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.
420
+ 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.
421
+ 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.
422
+ 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.
423
+
424
+ 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.
425
+ 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.
426
+ Mensch, A. and Blondel, M. Differentiable dynamic programming for structured prediction and attention. In International Conference on Machine Learning, pp. 3462-3471. PMLR, 2018.
427
+ 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.
428
+ Oktay, D., McGreivy, N., Aduol, J., Beatson, A., and Adams, R. P. Randomized automatic differentiation. In International Conference on Learning Representations, 2020.
429
+ 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.
430
+ 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.
431
+ 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.
432
+ 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.
433
+
434
+ 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.
435
+ 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.
436
+ 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.
437
+ 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.
438
+ 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.
439
+ Sutton, C. and McCallum, A. An introduction to conditional random fields for relational learning. Introduction to statistical relational learning, 2:93-128, 2006.
440
+ Wainwright, M. J. and Jordan, M. I. Graphical models, exponential families, and variational inference. Now Publishers Inc, 2008.
441
+ 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.
442
+ 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.
443
+ Zhang, Y., Li, Z., and Zhang, M. Efficient second-order treecrf for neural dependency parsing. arXiv preprint arXiv:2005.00975, 2020.
444
+
445
+ # A. Biasedness Analysis of Randomized Forward
446
+
447
+ 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.
448
+
449
+ 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$ .
450
+
451
+ 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:
452
+
453
+ $$
454
+ \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}
455
+ $$
456
+
457
+ 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}$ :
458
+
459
+ $$
460
+ \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}
461
+ $$
462
+
463
+ Notice how we re-index the sum. Now put it back to Eq. 35 to get:
464
+
465
+ $$
466
+ \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}
467
+ $$
468
+
469
+ This verifies the induction foundation that $\mathbb{E}_{q_1}[\hat{\alpha}_2(i)] = \alpha_2(i)$ for all $i$ .
470
+
471
+ Now assume for all time index up to $t$ we have:
472
+
473
+ $$
474
+ \forall i, \mathbb {E} _ {q _ {1: t - 1}} [ \hat {\alpha} _ {t} (i) ] = \alpha_ {t} (i) \tag {44}
475
+ $$
476
+
477
+ Consider $t + 1$ , we have:
478
+
479
+ $$
480
+ \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}
481
+ $$
482
+
483
+ 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:
484
+
485
+ $$
486
+ 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}
487
+ $$
488
+
489
+ This gives us:
490
+
491
+ $$
492
+ \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}
493
+ $$
494
+
495
+ 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).
496
+
497
+ 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$ .
498
+
499
+ 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:
500
+
501
+ $$
502
+ \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}
503
+ $$
504
+
505
+ $$
506
+ \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}
507
+ $$
508
+
509
+ 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)$
510
+
511
+ 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.
512
+
513
+ # B. Variance Analysis of Randomized Forward
514
+
515
+ 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:
516
+
517
+ $$
518
+ \mathbb {E} \left[ a _ {\delta} / q _ {\delta} \right] = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} \tag {59}
519
+ $$
520
+
521
+ We have the folling variance arguments:
522
+
523
+ Theorem B.1 (Variance of the tail estimator).
524
+
525
+ $$
526
+ \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}
527
+ $$
528
+
529
+ where
530
+
531
+ $$
532
+ S _ {K _ {1}} = \sum_ {i = K _ {1} + 1} ^ {N} a _ {i} \quad \epsilon_ {i} = a _ {i} / S _ {K _ {1}} - q _ {i} \tag {62}
533
+ $$
534
+
535
+ which says the variance is:
536
+
537
+ - quadratic to the tail sum $S_{K_1}$ , which will be reduced by increasing $K_1$ as the effect of Rao-Blackwellization.
538
+ - 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.
539
+
540
+ Optimal zero variance is achieved on
541
+
542
+ $$
543
+ q _ {i} ^ {*} = a _ {i} / S _ {K _ {1}} \tag {63}
544
+ $$
545
+
546
+ Proof. The variance is then:
547
+
548
+ $$
549
+ \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}
550
+ $$
551
+
552
+ where the first term is the second moment:
553
+
554
+ $$
555
+ \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}
556
+ $$
557
+
558
+ taking the expectation of it we get:
559
+
560
+ $$
561
+ \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}
562
+ $$
563
+
564
+ Plug this back, variance is:
565
+
566
+ $$
567
+ \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}
568
+ $$
569
+
570
+ To get the optimal proposal, we solve the constrained optimization problem:
571
+
572
+ $$
573
+ \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}
574
+ $$
575
+
576
+ $$
577
+ s. t. \sum_ {i = K _ {1} + 1} ^ {N} q _ {i} = 1 \tag {72}
578
+ $$
579
+
580
+ By solving the corresponding Lagrangian equation system (omitted here), we get the optimal value achieved at:
581
+
582
+ $$
583
+ 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}
584
+ $$
585
+
586
+ This says zero variance is achieved by a proposal equal to the normalized summands.
587
+
588
+ Then define the gap between the proposal and the normalized summands as:
589
+
590
+ $$
591
+ \epsilon_ {i} = \frac {a _ {i}}{S _ {K _ {1}}} - q _ {i} \tag {74}
592
+ $$
593
+
594
+ Plug this to the variance expression we get:
595
+
596
+ $$
597
+ \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}
598
+ $$
599
+
600
+ Corollary B.2. When increasing the sample size to $K_{2}$ , the variance will reduce to
601
+
602
+ $$
603
+ \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}
604
+ $$
605
+
606
+ 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:
607
+
608
+ Theorem B.3 (Single Step Asymptotic Variance of Sampled Forward). At each step, the alpha variable estimator has the following asymptotic variance:
609
+
610
+ $$
611
+ \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}
612
+ $$
613
+
614
+ where:
615
+
616
+ - $\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.
617
+ - $\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.
618
+
619
+ Proof. We start with a simple setting where $K_{2} = 1$ . At step $t + 1$ we have the following variance recursion:
620
+
621
+ $$
622
+ \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}
623
+ $$
624
+
625
+ This is derived by plugging estimator 17 to the variance Eq. 60 we have just derived. Denote:
626
+
627
+ $$
628
+ \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}
629
+ $$
630
+
631
+ Then we have
632
+
633
+ $$
634
+ \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}
635
+ $$
636
+
637
+ where $\epsilon_t(j,i)$ is the differences between the proposal and the normalized exact summands at step $t$ state $i$ :
638
+
639
+ $$
640
+ \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}
641
+ $$
642
+
643
+ Dropping out the first order errors and increasing the number of sample to $K_{2}$ , we have the asymptotics:
644
+
645
+ $$
646
+ \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}
647
+ $$
648
+
649
+ Theorem B.4 (Asymptotic Variance of Sampled Forward Partition Estimation). The alpha variable estimators has the following asymptotic variance recursion:
650
+
651
+ $$
652
+ \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}
653
+ $$
654
+
655
+ Compared with Eq. 77, this expression:
656
+
657
+ - 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).
658
+ - $\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).
659
+
660
+ Consequently, the partition function has the following asymptotic variance:
661
+
662
+ $$
663
+ \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}
664
+ $$
665
+
666
+ When implemented in the log space, the variance is trivially reduced exponentially:
667
+
668
+ $$
669
+ \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}
670
+ $$
671
+
672
+ Proof. Firstly for simplicity we assume $K_{1} = 0$ and $K_{2} = 1$ . The estimator variance is:
673
+
674
+ $$
675
+ \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}
676
+ $$
677
+
678
+ Recall:
679
+
680
+ $$
681
+ \alpha_ {t + 1} (i) = \sum_ {j = 1} ^ {N} \alpha_ {t} (j) \phi (j, i) \phi \left(x _ {t}, i\right) \tag {88}
682
+ $$
683
+
684
+ Let:
685
+
686
+ $$
687
+ \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}
688
+ $$
689
+
690
+ Then:
691
+
692
+ $$
693
+ \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}
694
+ $$
695
+
696
+ Note that there exist $J_{t}$ such that:
697
+
698
+ $$
699
+ \frac {\mathbb {E} _ {q _ {1 : t - 1}} \left[ \hat {\alpha} _ {t} ^ {2} (j) \right]}{\alpha_ {t} ^ {2} (j)} < = J _ {t} \tag {93}
700
+ $$
701
+
702
+ This is because of the bounded gap of the Jensen's inequality. Also recall:
703
+
704
+ $$
705
+ \sum_ {j = 1} ^ {N} q _ {t} (j) = 1 \tag {94}
706
+ $$
707
+
708
+ So we get:
709
+
710
+ $$
711
+ \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}
712
+ $$
713
+
714
+ 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:
715
+
716
+ $$
717
+ \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}
718
+ $$
719
+
720
+ 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:
721
+
722
+ $$
723
+ \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}
724
+ $$
725
+
726
+ Recursively expand this equation we get:
727
+
728
+ $$
729
+ \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}
730
+ $$
731
+
732
+ Chaning the implementation to the log space we reduce the variance exponentially:
733
+
734
+ $$
735
+ \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}
736
+ $$
737
+
738
+ ![](images/67f7d18eb4c3128f7487ba477776d1e0c5c2ed381d6258b5b55060cdfa305a1f.jpg)
scalingstructuredinferencewithrandomization/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fa28337c5ca3806e3927ddcf7dc7435cd97a402d98a20932e45876f0373b158
3
+ size 1027188
scalingstructuredinferencewithrandomization/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a48eb8221f4329d21cf480bde7797abf68937d8c577833bd020a63fcc6b62d47
3
+ size 739825
scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87259f6d815aad9010f5ea8b744a23e1b832620a01b3e51298a66d26866cd399
3
+ size 251649
scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd849c27276a8e651d46f7162def4c9ac42f7010b77040f737e2dea3daed9328
3
+ size 291400
scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/0046e3ab-8bf6-4fb4-9ed4-08c5c3c3aa30_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7916b258e434af1aaf805ec77af5620843abdab13a12fa4b4e7a36bd1e91588e
3
+ size 1091408
scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/full.md ADDED
The diff for this file is too large to render. See raw diff
 
scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26324cf155cc8da764de29e0d6d5c2d4e7e30bdccaa3b1534e3f4f06f4938cc4
3
+ size 1656341
scalingupdiverseorthogonalconvolutionalnetworksbyaparaunitaryframework/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a03ecf6a87418bdcc87632661acbe64d5ce26103c944f9472f61c2554258412
3
+ size 1424109
scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9bad1d86432460aa01bd68429006e24bf3fba4ced12b23ee9bfbb5fd9b25b09a
3
+ size 170133
scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4490268bf7062b42323cc77951f4c84851b379e3723f243b91fa57537701097b
3
+ size 200715
scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/6dd4d21b-c743-449c-976d-5bfc5602bbc0_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2236aadf570e507750f7740218f367fcf432e85ae64aabd06ce21fc22e68e5e5
3
+ size 6344485
scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/full.md ADDED
The diff for this file is too large to render. See raw diff
 
scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b27a9cdd8699cb2eef1e36976c38b06ca94ee2e2ae8a8a656b81b6eb855e3793
3
+ size 1662483
scorebasedgenerativemodelingofgraphsviathesystemofstochasticdifferentialequations/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:222d7a477c6779f70f321a762f0430c8062ce529352f2d48e67b98d58ee3eeec
3
+ size 843719
scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4625151a9443581691c42c6f45dd8851e8f253da1e53713891abbfff4e70402b
3
+ size 250830
scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f346dcffd36d57882bb85db7ae81d03af04822e3290a7c3a826c39b3d85b7edd
3
+ size 296905
scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/a85ed27b-3268-4172-bf69-4277fcd8d19c_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1cea0d35b9708717dbdd92b8c47b12f147aec118184d3651c7682a043e079a44
3
+ size 13811618
scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/full.md ADDED
The diff for this file is too large to render. See raw diff
 
scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0f759835f77f568a099437abafaad52db1a1a438821c9a004608398fbe61aeb
3
+ size 1803405
scoreguidedintermediateleveloptimizationfastlangevinmixingforinverseproblems/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d873f6d34297cb5da08f9308eeedbbf5683bc5f5bf5180fea0da0448b915ff
3
+ size 1816744
scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9d84d4e0cb528ee559c365a78fb0dc64ea9fd6f52d65f9b9e2b23a6d3b03e7a
3
+ size 96416
scorematchingenablescausaldiscoveryofnonlinearadditivenoisemodels/cedd144a-a605-4564-95bc-8044881af827_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e2c45dd9f17d655e5f6135ad2ad8ebdef66b528c673e59d2bf5ba095f802ae1
3
+ size 115671