SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Algorithm 3: Online consistent  $(k,z)$ -clustering
Input: Offline algorithm  $\mathcal{A}$  for  $(k,z)$ -clustering, approximation ratio  $1 + \epsilon$ ,  $\epsilon \in (0,1)$ .  
1  $\epsilon' \gets \epsilon/3$ .  
2 for  $t = 1,\ldots,n$  do  
3 Construct an  $\epsilon'$ -coreset  $C_{t-1} = (S_{t-1},\omega_{t-1})$  on  $X_{t-1}$ .  
4 Obtain a cluster set  $Z_t$  by running a PTAS  $\mathcal{A}$  with approximation ratio of  $(1 + \epsilon')$  on  $C_{t-1}$ .  
5 Receive  $x_t \in \mathbb{R}^d$  and  $\ell(Z_t,x_t) \in \mathbb{R}_+$ .
Theorem 6.1. For any  $\epsilon \in (0,1)$ , Algorithm 3 gives a regret bound of
$$
\operatorname {R e g r e t} _ {\epsilon} (n) \leq O \left(\left((1 6 8 z) ^ {1 0 z} \epsilon^ {- 5 z - 1 5} k ^ {5} \log \frac {k n}{\epsilon} + \epsilon^ {- 2 z - 2} k \log k \log \frac {k n}{\epsilon}\right) \log n\right).
$$
Moreover, there exists an algorithm that enjoys the same regret bound and an inconsistency bound of Inconsistency  $(n) = O\left(\left((168z)^{10z}\epsilon^{-5z - 15}k^5\log (\epsilon^{-1}kn) + \epsilon^{-2z - 2}k\log k\log (\epsilon^{-1}kn)\right)\log n\right)$  for  $(k,z)$ -clustering.
Remark 6.1. When  $z = 2$ , previous results for the adversarial setting show an  $\epsilon$ -approximate regret bound of  $O(k\sqrt{d^3n}\log (\epsilon^{-1}dkn))$  [Cohen-Addad et al., 2021]. In comparison, although our regret is for the random-order model, our method and results accommodate a range of values for  $z$ , and the regret bound is only polylogarithmically dependent on  $n$  and is independent of the dimension  $d$ .
7 Online Low-Rank Matrix Approximation
Low-rank matrix approximation serves as a fundamental tool in statistics and machine learning. The problem is to find a rank- $k$  matrix that approximates an input matrix  $\mathbf{A} \in \mathbb{R}^{d \times n}$  as much as possible. In this section, we apply the transformation framework to the offline approximation algorithm to obtain a low regret online algorithm.
7.1 Problem setup
Low-rank matrix approximation By the singular value decomposition (SVD), a rank- $r$  matrix  $\mathbf{A} \in \mathbb{R}^{d \times n}$  can be decomposed as  $\mathbf{A} = \mathbf{U} \boldsymbol{\Sigma} \mathbf{V}^{\top}$ , where  $\mathbf{U} \in \mathbb{R}^{d \times r}$  and  $\mathbf{V} \in \mathbb{R}^{n \times r}$  are orthonormal matrices,  $\boldsymbol{\Sigma} \in \mathbb{R}^{r \times r}$  is a diagonal matrix with  $\mathbf{A}$ 's singular values on the diagonal. The best rank- $k$  approximation of  $\mathbf{A}$  is given by
$$
\mathbf{A}_{k} = \mathbf{U}_{k}\boldsymbol{\Sigma}_{k}\mathbf{V}_{k}^{\top} = \operatorname *{argmin}_{\mathbf{B}\in \mathbb{R}^{d\times n}:\mathrm{rank}(\mathbf{B})\leq k}\| \mathbf{A} - \mathbf{B}\|_{F}  ,
$$
where  $\| \cdot \|_F$  denotes the Frobenius norm,  $\Sigma_k \in \mathbb{R}^{k \times k}$  is a diagonal matrix with  $\mathbf{A}_k$ 's top  $k$  singular values on the diagonal, and  $\mathbf{U}_k \in \mathbb{R}^{d \times k}$  and  $\mathbf{V}_k \in \mathbb{R}^{n \times k}$  are orthonormal matrices obtained from  $\mathbf{U}$  and  $\mathbf{V}$ , respectively, by gathering corresponding columns. The best rank- $k$  approximation can also be found by projecting  $\mathbf{A}$  onto the span of its top  $k$  singular vectors, that is,  $\mathbf{A}_k = \mathbf{U}_k \mathbf{U}_k^\top \mathbf{A}$ . Then, we can say an orthonormal matrix  $\mathbf{Z}$  is an  $\epsilon$ -approximate solution if
$$
\left\| \mathbf {A} - \mathbf {Z Z} ^ {\top} \mathbf {A} \right\| _ {F} \leq (1 + \epsilon) \left\| \mathbf {A} - \mathbf {U} _ {k} \mathbf {U} _ {k} ^ {\top} \mathbf {A} \right\| _ {F}.
$$
The matrix approximation problem serves as an important tool in data analytics and is closely related to numerous machine learning methods such as principal component analysis and least squares analysis. When dealing with streaming data, the online version of the matrix approximation problem becomes a vital tool for designing online versions of the machine learning algorithms mentioned above.
Online matrix approximation Through a time horizon of  $n$ , we receive a column of  $\mathbf{A}$ ,  $a_{t} \in \mathbb{R}^{d}$  at each time step  $t$ . We are then asked to compute  $\mathbf{Z}_{t} \in \mathbb{R}^{d \times k}$  that minimizes
$$
\ell (\mathbf {Z} _ {t}, a _ {t}) = \left\| a _ {t} - \mathbf {Z} _ {t} \mathbf {Z} _ {t} ^ {\top} a _ {t} \right\| _ {F}.
$$
Without loss of generality, we will assume that the losses are bounded between  $[0, 1]$ . We remark that similar assumptions are also made in Nie et al. [2016].
The online matrix approximation problem serves as a core component of online machine learning algorithms such as principle component analysis. These algorithms are important to a range of applications, such as online recommendation systems and online experimental design [Warmuth and Kuzmin, 2008, Nie et al., 2016].
7.2 Method and results
In the context of low-rank matrix approximation, the coreset of a matrix is called the projection-cost preserving samples, defined as follows:
Definition 7.1 (Rank- $k$  Projection-Cost Preserving Sample Cohen et al. [2017]). For  $n' < n$ , a subset of rescaled columns  $\mathbf{C} \in \mathbb{R}^{d \times n'}$  of  $\mathbf{A} \in \mathbb{R}^{d \times n}$  is a  $(1 + \epsilon)$  projection-cost preserving sample if, for all rank- $k$  orthogonal projection matrices  $\mathbf{X} \in \mathbb{R}^{d \times d}$ ,  $(1 - \epsilon)\| \mathbf{A} - \mathbf{X}\mathbf{A}\|_F^2 \leq \| \mathbf{C} - \mathbf{X}\mathbf{C}\|_F^2 \leq (1 + \epsilon)\| \mathbf{A} - \mathbf{X}\mathbf{A}\|_F^2$ .
Such sketches that satisfy Definition 7.1 can be constructed via importance sampling-based routines, which are modifications of the "leverage scores". Specifically, for the  $i$ -th column  $a_{i}$  of matrix  $A$
the ridge leverage score is defined as  $\tau_{i}(\mathbf{A}) = a_{i}^{\top}\left(\mathbf{A}\mathbf{A}^{\top} + \frac{\|\mathbf{A} - \mathbf{A}_{k}\|_{F}^{2}}{k}\mathbf{I}\right)^{\dagger}a_{i}$ , where  $\dagger$  denotes the Moore-Penrose pseudoinverse of a matrix [Cohen et al., 2017].
Now, we introduce our online matrix approximation algorithm in Algorithm 4, which builds upon our transformation framework. It computes the approximation of the matrix from the sketch derived from the aggregated matrix using ridge leverage scores.
Algorithm 4: Online low rank matrix approximation
Input: Approximation parameters  $\epsilon \in (0,1)$    
1 Set  $\delta = O(\epsilon /n)$  and  $m = O\left(\epsilon^{-2}k\log (\delta^{-1}k)\right)$    
2 for  $t = 1,\ldots ,n$  do   
3 Construct  $\mathbf{A}_{t - 1}\in \mathbb{R}^{d\times (t - 1)}$  by concatenating  $a_1,\dots a_{t - 1}$    
4 Let  $\mathbf{C}_{t - 1}\in \mathbb{R}^{d\times m}$  be the zero matrix.   
5 for  $j = 1,\ldots ,m$  do   
6 Sample the  $i$  -th column  $a_i\in \mathbb{R}^d$  of  $\mathbf{A}_{t - 1}$  with probability  $p_i\coloneqq \frac{\tau_i(\mathbf{A}_{t - 1})}{\sum_{j = 1}^{t - 1}\tau_j(\mathbf{A}_{t - 1})}$    
7 Sample  $w\in \mathbb{R}$  uniformly from  $[1 / \sqrt{tp_i},(1 + \epsilon) / \sqrt{tp_i} ]$    
8 Replace the  $j$  -th column of  $\mathbf{C}_{t - 1}$  with  $w\cdot a_{i}$    
9 Set  $\mathbf{Z}_t\in \mathbb{R}^{d\times k}$  to the top  $k$  left singular vectors of  $\mathbf{C}_t$    
10 Receive  $a_{t}\in \mathbb{R}^{d}$  and  $\ell (\mathbf{Z}_t,a_t)\in \mathbb{R}_+$
Theorem 7.2. For any  $\epsilon \in (0,1)$ , Algorithm 4 has regret  $\mathrm{Regret}_{\epsilon}(n) = O\left(\epsilon^{-2}k\log n\log (\epsilon^{-1}kn)\right)$ . Moreover, there exists an algorithm for online low-rank matrix approximation that enjoys the same regret bound and an inconsistency bound of Inconsistency  $(n) = O\left(\epsilon^{-2}k\log n\log (\epsilon^{-1}kn)\right)$ .
Remark 7.1. The online matrix approximation with the random-order setting has previously been investigated in the context of principle component analysis by Garber et al. [2020]. They established a regret of  $O\left(\zeta^{-1}\sqrt{kn}\right)$ , where  $\zeta$  is the smallest difference between two eigenvalues of  $\mathbf{A}_t\mathbf{A}_t^\top$ . In contrast, our result gives a polylogarithmic result on  $\epsilon$ -regret, which translates to an exact regret of  $O\left(\epsilon \mathrm{OPT} + O\left(\epsilon^{-2}k\log n\log (\epsilon^{-1}kn)\right)\right)$ , with OPT being the minimum possible cumulative loss attained by the hindsight best approximate.
8 Online Regression
In the online regression problem, at each time step  $t \in [n]$ , we are asked to output a vector  $x_{t} \in \mathbb{R}^{d}$  and then we receive vectors  $a_{t} \in \mathbb{R}^{d}$  and  $b_{t} \in \mathbb{R}$  that incurs the loss of  $\ell(x_{t}, a_{t}, b_{t}) = \|a_{t}^{\top} x_{t} - b\|_{2}$ . Without loss of generality, we assume that the losses are bounded between [0, 1]. We note that similar assumptions are also made in [Cesa-Bianchi et al., 1996, Ouhamma et al., 2021].
With our general reduction framework, we show an  $\epsilon$ -regret upper bound as follows.
Theorem 8.1. For any  $\epsilon \in (0,1)$ , Algorithm 5 has regret  $\mathrm{Regret}_{\epsilon}(n) = O\left(\epsilon^{-2}d\log n\log (\epsilon^{-1}dn)\right)$ . Moreover, there exists an algorithm for online regression that enjoys the same regret bound and an inconsistency bound of Inconsistency  $(n) = O\left(\epsilon^{-2}d\log n\log (\epsilon^{-1}dn)\right)$ .
Remark 8.1. In the stochastic setting, the online regression problem has been extensively investigated [Foster, 1991, Littlestone et al., 1995, Cesa-Bianchi et al., 1996, Ouhamma et al., 2021]. Using online ridge regression or forward algorithms, the regret is shown to be  $O(d\log n)$ . In the random-order model setting, Garber et al. [2020], Sherman et al. [2021] give  $O(\sqrt{n})$ -type regret when the matrix A has a small condition number. In comparison, our result attains polylogarithmic  $\epsilon$ -approximate regret, while maintaining no requirement on the loss function or the condition number. Our result can be translated to an exact regret of  $O\left(\epsilon \mathrm{OPT} + O\left(\epsilon^{-2}d\log n\log (\epsilon^{-1}dn)\right)\right)$ , with OPT being the minimum possible cumulative loss attained by the hindsight best parameter.
8.1 Method and results
Similar to the low-rank matrix approximation problem, we utilize the leverage score method to learn a subspace that preserves information regarding the regression. Specifically, we use the leverage score to learn a  $\epsilon$ -subspace embedding, which is defined as follows.
Definition 8.2 ( $\epsilon$ -Subspace Embedding). A matrix  $\mathbf{S} \in \mathbb{R}^{m \times n}$  is said to be an  $\epsilon$ -subspace embedding of  $\mathbf{A} \in \mathbb{R}^{n \times d}$  if for any vector  $x \in \mathbb{R}^d$ , we have  $(1 - \epsilon)\| \mathbf{A}x \| \leq \| \mathbf{S}\mathbf{A}x \| \leq (1 + \epsilon)\| \mathbf{A}x \|$ .
The subspace embedding serves the same functionality as coreset in the problem of online regression, it preserves the loss of information while enjoying a much lower dimension. In the online regression problem context, we define the leverage score as follows.
Definition 8.3 (Leverage Score). Let  $\mathbf{A} = \mathbf{U}\pmb{\Sigma}\mathbf{V}^{\top}$  be the singular value decomposition of  $\mathbf{A} \in \mathbb{R}^{n\times d}$ . For  $i \in [n]$ , the  $i$ -th leverage score of  $\mathbf{A}$ , is defined as  $\tau_{i} = \| \mathbf{U}_{i,:}\|_{2}^{2}$ .
With the leverage score, we propose Algorithm 5. The algorithm follows the general transformation framework, where the regression problem is solved at every step with the sketch derived from the aggregated matrix using leverage score. For notational convenience, we construct the sketch by appending rows instead of columns as we did in Section 7.
Algorithm 5: Online consistent regression
Input: Approximation parameters  $\epsilon \in (0,1)$    
1 Set  $\delta = O(\epsilon /n)$  and  $m = O\left(\epsilon^{-2}d\log (\delta^{-1}d)\right)$    
2 for  $t = 1,\dots ,n$  do   
3 Construct  $\mathbf{A}_{t - 1}\in \mathbb{R}^{(t - 1)\times d}$  by stacking  $a_1^\top ,\ldots a_{t - 1}^\top$    
4 Construct  $b\in \mathbb{R}^{t - 1}$  by stacking  $b_{1},\ldots ,b_{t - 1}$    
5 Set  $\mathbf{S}^t\in \mathbb{R}^{m\times (t - 1)}$  be the zero matrix.   
6 for  $j = 1,\dots ,m$  do   
7 Sample  $i\in [t - 1]$  with probability  $p_i\coloneqq \frac{\tau_i(\mathbf{A}_{t - 1})}{\sum_{j = 1}^{t - 1}\tau_j(\mathbf{A}_{t - 1})}$    
8 Sample  $w\in \mathbb{R}$  uniformly from  $\left[\frac{1}{\sqrt{mp_i}},\frac{1 + \epsilon}{\sqrt{mp_i}}\right]$    
9 Replace the  $j$  -th row of  $\mathbf{S}^t$  with  $w\cdot e_i^\top$  , where  $e_i\in \mathbb{R}^{t - 1}$  is a one-hot vector with 1 on the  $i$  -th index.   
10 Solve the regression problem  $x_{t} = \min_{x}\| \mathbf{S}^{t}\mathbf{A}_{t - 1}x - \mathbf{S}^{t}b\|_{2}$  , e.g., by an iterative method such as Newton's method.   
11 Receive  $a_{t}\in \mathbb{R}^{d}$ $b_{t}\in \mathbb{R}$  , and loss  $\ell (x_t,a_t,b_t)$
The subspace embedding result of Woodruff [2014] immediately shows the following:
Theorem 8.4. For any  $\epsilon, \delta \in (0,1)$ , if  $m = O\left(\epsilon^{-2}d\log (\delta^{-1}d)\right)$ , then with probability  $\geq 1 - \delta$ ,  $\mathbf{S}^t$  is an  $\epsilon$ -subspace embedding for  $\mathbf{A}_{t-1}$  with  $O\left(\epsilon^{-2}d\log (\delta^{-1}d)\right)$  columns.
To obtain Theorem 8.1, we first analyze the average sensitivity of the leverage score sampling. Then, with Theorem 8.4 and the general reduction Theorem 4.1, we obtain the regret bound.
9 Experiments
We here provide a preliminary empirical evaluation of our framework in the context of online  $k$ -means clustering, and online linear regression, with the result shown in Figure 1. Our experiments are conducted with various approximation ratios and experimental setups ( $\epsilon = 0.1, 0.01, 0.001$ , with  $k = 3$  or  $k = 5$  clusters). We then compare the performance of the proposed algorithm to the hindsight optimal solution. For  $k$ -means clustering, we obtain the hindsight optimal solution by applying  $k$ -means++ to all the data. In the context of regression, we utilize the least square formula to compute the hindsight optimal solution. Our experimental results demonstrate that the proposed algorithm is highly effective, and its performance aligns with our theoretical findings.
(a)  $k$  -means, 3 clusters
(b)  $k$ -means, 5 clusters
Figure 1: Experimental results for  $k$ -means clustering with 3, 5 clusters and online regression. Each experiment is repeated with 5 different random seed to ensure reproducible results. The shaded region indicates the 1 standard deviation.
(c) Regression
10 Conclusion
In this paper, we proposed a batch-to-online transformation framework that designs consistent online approximation algorithms from offline approximation algorithms. Our framework transforms an offline approximation algorithm with low average sensitivity to an online algorithm with low approximate regret. We then show a general method that can transform any offline approximation algorithm into one with low sensitivity by using a stable coreset. To demonstrate the generality of our framework, we applied it to online  $(k,z)$ -clustering, online matrix approximation, and online regression. Through the transformation result, we obtain polylogarithmic approximate regret for all of the problems mentioned.
This work is supported by JSPS KAKENHI Grant Number 20H05965 and 22H05001.
Pankaj K Agarwal, Sariel Har-Peled, Kasturi R Varadarajan, et al. Geometric approximation via coresets. Combinatorial and computational geometry, 52(1):1-30, 2005.
Rajeev Agrawal, MV Hedge, and Demosthenis Teneketzis. Asymptotically efficient adaptive allocation rules for the multiarmed bandit problem with switching cost. IEEE Transactions on Automatic Control, 33(10):899-906, 1988.
Vladimir Braverman, Dan Feldman, Harry Lang, Adiel Statman, and Samson Zhou. New frameworks for offline and streaming coreset constructions. arXiv preprint arXiv:1612.00889, 2016.
Nicolo Cesa-Bianchi, Philip M Long, and Manfred K Warmuth. Worst-case quadratic loss bounds for prediction using linear functions and gradient descent. IEEE Transactions on Neural Networks, 7(3):604-619, 1996.
Nicolo Cesa-Bianchi, Ofer Dekel, and Ohad Shamir. Online learning with switching costs and other adaptive adversaries. Advances in Neural Information Processing Systems, 2013.
Michael B Cohen, Cameron Musco, and Christopher Musco. Input sparsity time low-rank approximation via ridge leverage score sampling. In Proceedings of the 2017 Annual ACM-SIAM Symposium on Discrete Algorithms, 2017.
Vincent Cohen-Addad, Benjamin Guedj, Varun Kanade, and Guy Rom. Online  $k$ -means clustering. In International Conference on Artificial Intelligence and Statistics, 2021.
Dan Feldman and Michael Langberg. A unified framework for approximating and clustering data. In Proceedings of the 43th Annual ACM SIGACT Symposium on Theory of Computing, 2011.
Dean P Foster. Prediction in the worst case. The Annals of Statistics, pages 1084-1090, 1991.
Dan Garber, Gal Korcia, and Kfir Levy. Online convex optimization in the random order model. In International Conference on Machine Learning, 2020.
Sariel Har-Peled and Soham Mazumdar. On coresets for  $k$ -means and  $k$ -median clustering. In Proceedings of the 36th Annual ACM SIGACT Symposium on Theory of Computing, 2004.
Satoshi Hara and Yuichi Yoshida. Average sensitivity of decision tree learning. In International Conference on Learning Representations, 2023.
Lingxiao Huang and Nisheeth K Vishnoi. Coresets for clustering in Euclidean spaces: importance sampling is nearly optimal. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, 2020.
Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63(4):512-530, 2001.
Soh Kumabe and Yuichi Yoshida. Average sensitivity of dynamic programming. In Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms, 2022.
Silvio Lattanzi and Sergei Vassilvitskii. Consistent  $k$ -clustering. In International Conference on Machine Learning, 2017.
L Li, B Guedj, and S Loustau. A quasi-bayesian perspective to online clustering. Electronic Journal of Statistics, 12(2):3071-3113, 2018.
Nicholas Littlestone, Manfred K Warmuth, and Philip M Long. On-line learning of linear functions. Computational Complexity, 5:1-23, 1995.
Jiazhong Nie, Wojciech Kotlowski, and Manfred K Warmuth. Online PCA with optimal regret. The Journal of Machine Learning Research, 17(1):6022-6070, 2016.
Reda Ouhamma, Odalric-Ambrym Maillard, and Vianney Perchet. Stochastic online linear regression: the forward algorithm to replace ridge. Advances in Neural Information Processing Systems, 2021.
Pan Peng and Yuichi Yoshida. Average sensitivity of spectral clustering. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2020.
Uri Sherman, Tomer Koren, and Yishay Mansour. Optimal rates for random order online optimization. Advances in Neural Information Processing Systems, 2021.
Nithin Varma and Yuichi Yoshida. Average sensitivity of graph algorithms. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, 2021.
Manfred K Warmuth and Dima Kuzmin. Randomized online PCA algorithms with regret bounds that are logarithmic in the dimension. Journal of Machine Learning Research, 9(Oct):2287-2320, 2008.
David P Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends® in Theoretical Computer Science, 10(1-2):1-157, 2014.
Yuichi Yoshida and Shinji Ito. Average sensitivity of Euclidean  $k$ -clustering. In Advances in Neural Information Processing Systems, 2022.
Yuichi Yoshida and Samson Zhou. Sensitivity analysis of the maximum matching problem. In Innovations in Theoretical Computer Science Conference, pages 58:1-58:20, 2021.
A Proofs for Section 4
$$
\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X ^ {(i)}), x _ {i}) ] = \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X), x _ {i}) ] \pm \beta (n),
$$
Proof. We have
$$
\begin{array}{l} \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X ^ {(i)}), x _ {i}) ] \\ \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X), x _ {i}) ] + \frac {1}{n} \sum_ {i = 1} ^ {n} \left| \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X), x _ {i}) ] - \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X ^ {(i)}), x _ {i}) ] \right| \\ \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathcal {A}} [ \ell (\mathcal {A} (X), x _ {i}) ] + \frac {1}{n} \sum_ {i = 1} ^ {n} \mathrm {T V} (\mathcal {A} (X), \mathcal {A} (X ^ {(i)})) \\ \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \underset {\mathcal {A}} {\mathbb {E}} [ \ell (\mathcal {A} (X), x _ {i}) ] + \beta (n). \\ \end{array}
$$
The other direction can be shown analogously.
B Proofs for Section 5
In this section, we prove Lemma 5.2.
Lemma B.1. For any  $i \in [n]$  and  $x \in X^{(i)}$ , let  $\theta^{(i)} = \operatorname{argmax}_{\theta} \frac{\ell(\theta, x)}{\sum_{x' \in X^{(i)}} \ell(\theta, x')}$ . Then, we have
$$
0 \leq \sigma_ {X ^ {(i)}} (x) - \sigma_ {X} (x) \leq \frac {\ell (\theta^ {(i)} , x _ {i}) \cdot \ell (\theta^ {(i)} , x)}{\sum_ {x ^ {\prime} \in X ^ {(i)}} \ell (\theta^ {(i)} , x ^ {\prime}) \cdot \sum_ {x ^ {\prime} \in X} \ell (\theta^ {(i)} , x ^ {\prime})}.
$$
Proof. Denote  $\theta = \operatorname{argmax}_{\theta} \frac{\ell(\theta, x)}{\sum_{x' \in X} \ell(\theta, x')}$ , then for the left-hand side of the inequality, we have
$$
\begin{array}{l} \sigma_ {X ^ {(i)}} (x) - \sigma_ {X} (x) \geq \frac {\ell (\theta , x)}{\sum_ {x ^ {\prime} \in X ^ {(i)}} \ell (\theta , x ^ {\prime})} - \frac {\ell (\theta , x)}{\sum_ {x ^ {\prime} \in X} \ell (\theta , x ^ {\prime})} \\ \geq 0. \\ \end{array}
$$
For the second inequality, we have
$$
\begin{array}{l} \sigma_ {X ^ {(i)}} (x) - \sigma_ {X} (x) \leq \frac {\ell (\theta^ {(i)} , x)}{\sum_ {x ^ {\prime} \in X ^ {(i)}} \ell (\theta^ {(i)} , x ^ {\prime})} - \frac {\ell (\theta^ {(i)} , x)}{\sum_ {x ^ {\prime} \in X} \ell (\theta^ {(i)} , x ^ {\prime})} \\ = \frac {\ell (\theta^ {(i)} , x _ {i}) \cdot \ell (\theta^ {(i)} , x)}{\sum_ {x ^ {\prime} \in X ^ {(i)}} \ell (\theta^ {(i)} , x ^ {\prime}) \cdot \sum_ {x ^ {\prime} \in X} \ell (\theta^ {(i)} , x ^ {\prime})}. \\ \end{array}
$$
Lemma B.2. For any  $i\in [n]$  , we have
$$
\sum_ {i = 1} ^ {n} \left| \sum_ {x \in X} \sigma_ {X} (x) - \sum_ {x ^ {\prime} \in X ^ {(i)}} \sigma_ {X ^ {(i)}} \left(x ^ {\prime}\right) \right| \leq \sum_ {x \in X} \sigma_ {X} (x).
$$
Proof. By Lemma B.1, we have
$$
\sum_ {x \in X} \sigma_ {X} (x) - \sum_ {x ^ {\prime} \in X ^ {(i)}} \sigma_ {X ^ {(i)}} \left(x ^ {\prime}\right) = \sigma_ {X} \left(x _ {i}\right) - \sum_ {x \in X ^ {(i)}} \left(\sigma_ {X ^ {(i)}} (x) - \sigma_ {X} (x)\right) \leq \sigma_ {X} \left(x _ {i}\right),
$$
$$
\begin{array}{l} \sum_ {x \in X} \sigma_ {X} (x) - \sum_ {x ^ {\prime} \in X ^ {(i)}} \sigma_ {X ^ {(i)}} \left(x ^ {\prime}\right) = \sigma_ {X} \left(x _ {i}\right) - \sum_ {x \in X ^ {(i)}} \left(\sigma_ {X ^ {(i)}} (x) - \sigma_ {X} (x)\right) \\ \geq \sigma_ {X} (x _ {i}) - \sum_ {x \in X ^ {(i)}} \frac {\ell (\theta^ {(i)} , x _ {i}) \cdot \ell (\theta^ {(i)} , x)}{\sum_ {x ^ {\prime} \in X ^ {(i)}} \ell (\theta^ {(i)} , x ^ {\prime}) \cdot \sum_ {x ^ {\prime} \in X} \ell (\theta^ {(i)} , x ^ {\prime})} \\ = \sigma_ {X} \left(x _ {i}\right) - \frac {\ell \left(\theta^ {(i)} , x _ {i}\right)}{\sum_ {x ^ {\prime} \in X} \ell \left(\theta^ {(i)} , x ^ {\prime}\right)} \geq 0. \\ \end{array}
$$
Then, we have
$$
\begin{array}{l} \sum_ {i = 1} ^ {n} \left| \sum_ {x \in X} \sigma_ {X} (x) - \sum_ {x ^ {\prime} \in X ^ {(i)}} \sigma_ {X ^ {(i)}} \left(x ^ {\prime}\right) \right| = \sum_ {i = 1} ^ {n} \left(\sum_ {x \in X} \sigma_ {X} (x) - \sum_ {x ^ {\prime} \in X ^ {(i)}} \sigma_ {X ^ {(i)}} \left(x ^ {\prime}\right)\right) \\ \leq \sum_ {i = 1} ^ {n} \sigma_ {X} (x _ {i}) \leq \sum_ {x \in X} \sigma_ {X} (x). \\ \end{array}
$$
Lemma B.3. We have