SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
B ^ {*} = 2 1 \cdot S (r ^ {*}, \delta) + \max _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}
$$
be any fixed optimal sample size, where we remind the definition of  $U$  from (7). The first observation is that the right-hand side of the inequality in Theorem 1 is  $O(B^{*})$ . Therefore, in order to prove the theorem, it is sufficient to show that  $U(r_{j},\delta) / B^{*} = O(1)$ .
We distinguish two cases: (a)  $r^* < 2r_j$ , and (b)  $r^* \geq 2r_j$ . We first consider case (a). We let  $k \geq 0$  be the largest integer such that  $r_k \leq r^*$ . Since  $r^* < 2r_j$ , it holds that  $k \leq j$ . Since our algorithm returned  $r_j$ , Proposition 4 applies for  $i = 0, \ldots, j - 1$ , thus  $U(r_j, \delta) \leq U(r_k, \delta)$ . We have that:
$$
\frac {U \left(r _ {j} , \delta\right)}{B ^ {*}} \leq \frac {U \left(r _ {k} , \delta\right)}{B ^ {*}} \tag {8}
$$
$$
\begin{array}{l} \frac {U (r _ {k} , \delta)}{B ^ {*}} = \frac {2 1 S (r _ {k} , \delta) + \| P _ {T} - P _ {T} ^ {r _ {k}} \| _ {\mathcal {F}}}{2 1 S (r ^ {*} , \delta) + \max _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}} \leq \frac {2 1 S (r _ {k} , \delta) + \max _ {t <   r _ {k}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}}{2 1 S (r ^ {*} , \delta) + \max _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}} \\ \leq \frac {S (r _ {k} , \delta)}{S (r ^ {*} , \delta)} + \frac {\max  _ {t <   r _ {k}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}}{\max  _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}} \leq \sqrt {\frac {r ^ {*}}{r _ {k}}} + 1 \leq 3, \\ \end{array}
$$
where the first inequality is due to (2), and the last inequality is due to the fact that  $r_k \leq r^* < 2r_k$  by definition of  $r_k$ . By using the above inequality in (8), we obtain that  $U(r_j, \delta) / B^* \leq 3$ .
We consider case (b). Since  $T \geq r^{*} \geq 2r_{j} = r_{j + 1}$ , the algorithm returned  $r_{j}$  because  $\| \mathbb{P}_T^{r_j} - \mathbb{P}_T^{r_{j + 1}}\|_{\mathcal{F}} > 4S(r_j,\delta)$ . Using Proposition 5, we have
$$
\max _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}} \geq \max _ {t <   r _ {j + 1}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}} > S (r _ {j}, \delta).
$$
Therefore, we have that
$$
\begin{array}{l} \frac {U (r _ {j} , \delta)}{B ^ {*}} = \frac {2 1 S (r _ {j} , \delta) + \| P _ {T} - P _ {T} ^ {r _ {j}} \| _ {\mathcal {F}}}{2 1 S (r ^ {*} , \delta) + \max  _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}} \\ \leq \frac {2 1 S (r _ {j} , \delta)}{\max _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}} + \frac {\max _ {t <   r _ {j}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}}{\max _ {t <   r ^ {*}} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}} \leq \frac {2 1 S (r _ {j} , \delta)}{S (r _ {j} , \delta)} + 1 = 2 1 \\ \end{array}
$$
5 Binary Classification with Distribution Drift
In this section, we show an application of Theorem 1 for the fundamental statistical learning problem of agnostic learning a family of binary classifiers. Let  $\mathcal{Z} = \mathcal{X}\times \mathcal{Y}$ , where  $\mathcal{X}$  is the feature space, and  $\mathcal{Y} = \{0,1\}$  is the label space, i.e.  $Z_{t} = (X_{t},Y_{t})$ . A hypothesis class  $\mathcal{H}$  is a class of functions  $h:\mathcal{X}\mapsto \mathcal{Y}$  that classify the feature space  $\mathcal{X}$ . Given a point  $(x,y)\in \mathcal{X}\times \mathcal{Y}$  and a function  $h\in \mathcal{H}$ , the risk of  $h$  on  $(x,y)$  is defined through the following function  $L_{h}(x,y) = \mathbf{1}_{\{y\neq h(x)\}}$ . We work with the class of functions  $\mathcal{F} = \{L_h:h\in \mathcal{H}\}$ .
Let  $h^* = \operatorname{argmin}_{h \in \mathcal{H}} P_T(L_h)$  be a function with minimum expected risk with respect to the current distribution  $P_T$ . We want to use Theorem 1 to find a function  $h \in \mathcal{H}$  such that  $P_T(L_h)$  is close to  $P_T(L_{h^*})$ . Let  $\nu$  be the VC dimension of  $\mathcal{H}$ . The VC dimension describes the complexity of the family  $\mathcal{H}$ , and it is used to quantify the statistical error. In particular, using standard learning tools, it is possible to show that the family  $\mathcal{F}$  satisfies Assumption 1 on the sample complexity with constants  $C_{\mathcal{F},1} = O(\sqrt{\nu})$  and  $C_{\mathcal{F},2} = O(1)$  (e.g., [Mohri et al., 2018]).
Finally, to satisfy Assumption 2, we need to exhibit a procedure that for  $r \leq T/2$ , outputs the quantity  $\| \mathbb{P}_T^r - \mathbb{P}_T^{2r} \|_{\mathcal{F}}$ . This quantity is also referred to as  $\mathcal{V}$ -discrepancy between the empirical distributions  $\mathbb{P}_T^r$  and  $\mathbb{P}_T^{2r}$  in previous work on transfer learning [Mohri and Muñoz Medina, 2012]. We can adapt a strategy from Ben-David et al. [2010] to our setting and show that it is possible to compute it by solving an empirical risk minimization problem. We say that a hypothesis class  $\mathcal{H}$  is computationally tractable if given a finite set of points from  $\mathcal{X} \times \mathcal{Y}$ , there exists an algorithm that returns a hypothesis  $h$  that achieves the minimum risk over this set of points.
Lemma 6. Assume that  $\mathcal{H}$  is symmetric, i.e.  $h\in \mathcal{H}\iff 1 - h\in \mathcal{H}$ . For  $r\leq T / 2$ , it holds
$$
\| \mathbb {P} _ {T} ^ {r} - \mathbb {P} _ {T} ^ {2 r} \| _ {\mathcal {F}} = \frac {1}{2} - \frac {1}{2} \inf  _ {h \in \mathcal {H}} \left[ \frac {1}{r} \sum_ {t = T - r + 1} ^ {T} L _ {h} (X _ {t}, 1 - Y _ {t}) + \frac {1}{r} \sum_ {t = T - 2 r + 1} ^ {T - r} L _ {h} (X _ {t}, Y _ {t}) \right]
$$
Given  $r$ , the minimum in Lemma 6 can be computed by solving an empirical risk minimization over the most recent  $2r$  points, where we flip the label of half of those points, i.e. we use the points  $(X_{T - 2r + 1}, Y_{T - 2r + 1}), \ldots, (X_{T - r}, Y_{T - r}), (X_{T - r + 1}, 1 - Y_{T - r + 1}), \ldots, (X_T, 1 - Y_T)$ . Thus, if  $\mathcal{H}$  is computationally tractable and symmetric, Assumption 2 holds. This is indeed true for many hypothesis class, e.g., hyperplanes, axis-aligned rectangles, or threshold functions. However, the empirical risk minimization problem could be expensive to solve exactly, but as we discuss in Section 8, it is possible to modify the algorithm to allow for an approximation of  $\| \mathbb{P}_T^r - \mathbb{P}_T^{2r} \|_{\mathcal{F}}$ .
Our main result for binary classification is given in the following theorem:
Theorem 7. Let  $\mathcal{H}$  be a computationally tractable and symmetric binary class with VC dimension  $\nu$ . Let  $\mathcal{F} = \{L_h : h \in \mathcal{H}\}$ . Let  $\hat{r} \leq T$  be output of Algorithm 1 with input  $Z_1, \ldots, Z_T$  using the family  $\mathcal{F}$ . Let  $\hat{h} = \operatorname*{argmin}_{h \in \mathcal{H}} \mathbb{P}_T^{\hat{r}}(L_h)$  be an empirical risk minimizer over the most recent  $\hat{r}$  samples. With probability at least  $1 - \delta$ , the following holds:
$$
P _ {T} (L _ {\hat {h}}) - P _ {T} (L _ {h ^ {*}}) = O \left(\min _ {r \leq T} \left[ \sqrt {\frac {\nu}{r}} + \max _ {t <   r} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}} + \sqrt {\frac {\log (\log (r + 1) / \delta)}{r}} \right]\right)
$$
The symmetry assumption is not necessary, and in the appendix we show how to remove it at the cost of a more expensive computation of the discrepancy. It is instructive to compare this upper bound with the results of previous work. An often used assumption in the literature, originally introduced in Bartlett [1992], is that there is a known value  $\Delta > 0$ , such that drift in each step is bounded by  $\Delta$ , i.e. for all  $t < T$ ,  $\| P_{t+1} - P_t \|_{\mathcal{F}} \leq \Delta$ . Assume that  $T$  is sufficiently large, i.e.  $T = \Omega((\nu / \Delta^2)^{1/3})$ . By using this assumption on the drift, previous work showed that with high-probability, they can find a classifier  $\hat{h}$  such that  $P_T(L_{\hat{h}}) - P_T(L_{h^*}) = O\left(\sqrt[3]{\Delta \nu}\right)$ , and it can be shown that this upper bound is tight up to constants within those assumptions [Barve and Long, 1996]. These previous works assumed they had access a priori to the value of  $\Delta$ , since those algorithms compute  $\hat{h}$  by solving an empirical risk minimization over a number of previous samples  $\Theta((\nu / \Delta^2)^{1/3})$  that is decided before observing the data. On the other hand, this assumption on the drift together with (2) implies that  $\max_{t < r} \| P_T - P_{T-t} \|_{\mathcal{F}} \leq (r-1)\Delta$ . Our algorithm (Theorem 7) guarantees an error that depends on a minimum choice over  $r \leq T$ , hence it is always smaller than
the one obtained with a specific choice of  $r$ . If we choose  $r = (\nu/\Delta^2)^{1/3}$  in the upper bound of Theorem 7, we can show that with high-probability, our algorithm returns a classifier  $\hat{h}$  such that  $P_T(L_{\hat{h}}) - P_T(L_{h^*}) = O\left(\sqrt[3]{\Delta \nu} + \sqrt[6]{\Delta^2/\nu} \sqrt{\log \log(\nu/\Delta^2)}\right)$ . Our algorithm achieves this guarantee while being adaptive with respect to the upper bound  $\Delta$ , and it can indeed guarantee a better result when this upper bound is loose.
For example, assume an extreme case in which the algorithm is given a  $\Delta > 0$  bound on the drift in each step, but the training set has actually no drift, it was all drawn from the distribution  $P_T$ . Previous methods are oblivious to the actual data, and they guarantee an upper bound  $O\left(\sqrt[3]{\Delta\nu}\right)$  with high-probability, since they decide the sample size  $\Theta((\nu/\Delta^2)^{1/3})$  a priory without observing the input. In contrast, our algorithm adapts to this scenario, and Theorem 7 guarantees that we obtain an  $O\left(\sqrt{\nu/T} + \sqrt{(\log\log T)/T}\right)$  error, with high-probability, essentially retrieving the error guarantee for learning with independent and identically distributed samples. Observe that our upper bound depends on  $T$ , and it goes to 0 when  $T \to \infty$ .
It is possible to show that our algorithm can obtain asymptotically better guarantee even if  $\| P_t - P_{t-1} \|_{\mathcal{F}} = \Delta \ll 1$  for all  $t < T$ , i.e. there is an exact drift of  $\Delta$  at each step. This is because our algorithm provides a guarantee as a function of  $\max_{t < r} \| P_T - P_{T-t} \|_{\mathcal{F}}$  rather than the looser quantity  $\sum_{t=1}^{r-1} \| P_{T-t} - P_{T-t+1} \|_{\mathcal{F}}$ , as shown in the following example. Let  $\mathcal{X} = [0,1]$ , and let  $\mathcal{H}$  be a class of threshold functions over  $[0,1]$  i.e. for any  $c \in [0,1]$ , there exists classifiers  $h_c, h_c' \in \mathcal{H}$  such that  $h_c(x) = 1$  if and only if  $x \geq c$  and  $h_c'(x) = 1$  if and only if  $x < c$ . The class  $\mathcal{H}$  has VC-dimension equal to 2. We construct a sequence of distributions  $P_1, \ldots, P_T$  as follows. The marginal distribution over  $\mathcal{X}$  is uniform for each distribution  $P_t$  with  $t = 1, \ldots, T$ . At time  $t \leq T$ , the classification of  $x \in [0,1]$  is given by a function  $\ell_t : [0,1] \mapsto \{0,1\}$ . Assume that there exists two disjoint intervals  $I_0 = [p_0, p_0 + \Delta/2)$  and  $I_1 = [p_1, p_1 + \Delta/2)$  such that  $\ell_T(x) = 0$  for all  $x \in I_0$  and  $\ell_T(x) = 1$  for all  $x \in I_1$ . We let
$$
\ell_ {T - t} (x) = \left\{ \begin{array}{l l} 1 - \ell_ {T} (x) & \quad \text {i f} (x \in I _ {0}) \wedge (t \text {i s o d d}) \\ 1 - \ell_ {T} (x) & \quad \text {i f} (x \in I _ {1}) \wedge (t \text {i s e v e n}) \quad , \qquad \forall x \in \mathcal {X}, t <   T \\ \ell_ {T} (x) & \quad \text {o t h e r w i s e} \end{array} \right..
$$
In particular,  $\ell_{T - t}(x)$  differs from  $\ell_T(x)$  for  $x\in I_0$  if  $t$  is odd, and for  $x\in I_1$  if  $t$  is even. By construction,  $\| P_t - P_{t - 1}\|_{\mathcal{F}} = \Delta$  for all  $t < T$ , i.e. there is an exact drift of  $\Delta$  at each step (to be precise, in the last step  $\| P_T - P_{T - 1}\|_{\mathcal{F}} = \Delta /2$ ). As discussed before, with the assumption of a bounded drift  $\Delta$  at each step, previous methods guarantee an upper bound  $O(\sqrt[3]{\Delta})$  with high-probability. However, we also have that for any  $1\leq r\leq T$ , it holds by construction that
$$
\max _ {t <   r} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}} \leq \Delta .
$$
Hence, our algorithm (Theorem 7) guarantees with high-probability an upper bound
$$
O \left(\Delta + \sqrt {\nu / T} + \sqrt {(\log \log T) / T}\right).
$$
Since our algorithm is adaptive with respect to the drift, it can correctly use more samples. In contrast, previous non-adaptive algorithms that rely on the assumption of bounded drift  $\Delta$  at each step choose a sample size of  $\Theta (\Delta^{-2 / 3})$  based on this assumption, thus they can only guarantee a looser bound of  $O(\Delta^{1 / 3})$ , even when this assumption is satisfied with equality.
It is possible to use the recent lower bound strategy of Mazzetto and Upfal [2023] in order to show that the upper bound of Theorem 7 is essentially tight in a minimax sense.
Theorem 8. Let  $\mathcal{H}$  be a binary class with VC dimension  $\nu$ , and consider an arbitrary nondecreasing sequence  $\Delta_1 = 0, \Delta_2, \ldots, \Delta_T$  of non-negative real numbers. Let  $\mathcal{F} = \{L_h : h \in \mathcal{H}\}$ . Let  $\mathcal{A}$  be any algorithm that observes  $Z_1, \ldots, Z_T$ , and it outputs a classifier  $h_{\mathcal{A}} \in \mathcal{H}$ . If
$$
\Phi^ {*} = \min  _ {r \leq T} \left(\sqrt {\frac {\nu}{r}} + \Delta_ {r}\right) <   1 / 3,
$$
then, for any algorithm  $\mathcal{A}$ , there exists a sequence of distributions  $P_{1},\ldots ,P_{T}$  such that  $\max_{t < r}\| P_T - P_{T - t}\|_{\mathcal{F}}\leq \Delta_r$  for any  $r\le T$ , and with probability at least  $1 / 8$  it holds that:
$$
P _ {T} \left(L _ {h _ {\mathcal {A}}}\right) - P _ {T} \left(L _ {h ^ {*}}\right) = \Omega \left(\Phi^ {*}\right) = \Omega \left(\min  _ {r \leq T} \left(\sqrt {\frac {\nu}{r}} + \max  _ {t <   r} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}}\right)\right)
$$
6 Linear Regression with Squared Loss
In the previous section, we showed an application of Theorem 1 for the problem of binary classification with zero-one loss. In this section, we show that our main result can also be applied to a linear regression problem. Similarly to the previous section, we let  $\mathcal{Z} = \mathcal{X}\times \mathcal{Y}$ , where  $\mathcal{X}$  is the feature space and  $\mathcal{Y} = [-1,1]$  is the label space, i.e.  $Z_{t} = (X_{t},Y_{t})$ . In this section, we constrain the feature space  $\mathcal{X} = \{x\in \mathbb{R}^d:\| x\| _2\leq 1\}$  to be the unit ball centered at the origin in  $\mathbb{R}^d$ .
We consider the  $\ell_2$  regularized linear prediction class  $\mathcal{H} = \{x\mapsto \langle x,w\rangle :w\in \mathbb{R}^d\land \| w\| _2\leq 1\}$ . We denote each predictor  $h_w\in \mathcal{H}$  with its weight  $w$ . To evaluate the quality of a prediction  $y = h_w(x)$ , we use the squared loss  $L:\mathbb{R}\times \mathbb{R}\mapsto \mathbb{R}$  defined as  $L(y,y^{\prime}) = (y - y^{\prime})^{2}$ . For each  $h_w\in \mathcal{H}$ , we let  $L_{w}(x,y) = L(h_{w}(x),y)$  be the function that evaluates the loss incurred by  $h_w$  for any  $z = (x,y)\in \mathcal{Z}$ . We work with the family of functions  $\mathcal{F} = \{L_w:h_w\in \mathcal{H}\}$ . By a standard uniform convergence argument based on the Rademacher complexity of  $\mathcal{F}$  (e.g., see [Kakade et al., 2008, Shamir, 2015, Awasthi et al., 2020]), we have that for any  $1\leq r\leq T$ , it holds:
$$
\| P _ {T} ^ {r} - \mathbb {P} _ {T} ^ {r} \| _ {\mathcal {F}} = O \left(\frac {1}{\sqrt {r}} + \sqrt {\frac {\ln (1 / \delta)}{r}}\right),
$$
thus we satisfy Assumption 1 with  $C_{\mathcal{F},1} = O(1)$  and  $C_{\mathcal{F},2} = O(1)$ .
The computation of the discrepancy is more challenging. Let  $1 \leq r \leq T / 2$ . Using the definition of  $\mathcal{F}$ , we have that:
$$
\left\| \mathbb {P} _ {T} ^ {r} - \mathbb {P} _ {T} ^ {2 r} \right\| _ {\mathcal {F}} = \frac {1}{2 r} \sup  _ {w: \| w \| \leq 1} \left| \sum_ {t = T - r + 1} ^ {T} \left(Y _ {t} - \langle X _ {t}, w \rangle\right) ^ {2} - \sum_ {t = T - 2 r + 1} ^ {T - r} \left(Y _ {t} - \langle X _ {t}, w \rangle\right) ^ {2} \right|. \tag {9}
$$
Let  $c_{r}\in \mathbb{R},b_{r}\in \mathbb{R}^{d}$  , and  $A_{r}\in \mathbb{R}^{d\times d}$  be defined as follows:
$$
a _ {r} = \sum_ {t = T - r + 1} ^ {T} Y _ {t} ^ {2} - \sum_ {t = T - 2 r + 1} ^ {T - r} Y _ {t} ^ {2}, \quad b _ {r} = \sum_ {t = T - 2 r + 1} ^ {T - r} Y _ {t} X _ {t} - \sum_ {t = T - r + 1} ^ {T} Y _ {t} X _ {t},
$$
$$
A _ {r} = \sum_ {t = T - r + 1} ^ {T} X _ {t} ^ {T} X _ {t} - \sum_ {t = T - 2 r + 1} ^ {T - r} X _ {t} ^ {T} X _ {t},
$$
and observe that the matrix  $A_r$  is symmetric. Using those definition, we can manipulate the right-hand side of (9) to show that it is equivalent to:
$$
\left. \max  \left(- a _ {r} + \inf  _ {w: \| w \| \leq 1} \left[ w ^ {T} \left(- A _ {r}\right) w - 2 b _ {r} ^ {T} w \right], a _ {r} + \inf  _ {w: \| w \| \leq 1} \left[ w ^ {T} \left(A _ {r}\right) w - 2 \left(- b _ {r} ^ {T}\right) w \right]\right) \right. \tag {10}
$$
In order to compute (10), it is sufficient to be able to solve the minimization problem
$$
\inf  _ {w: \| w \| \leq 1} \left(w ^ {T} A w - 2 b ^ {T} w\right) \tag {11}
$$
where  $A \in \mathbb{R}^{d \times d}$  is a symmetric matrix, and  $b \in \mathbb{R}^d$ . This minimization problem has been extensively studied for the trust-region method [Conn et al., 2000], and Hager [2001, Section 2] provides a way to compute the solution of (11) in terms of a diagonalization of  $A$ . Thus, we also satisfy Assumption 2, and we can obtain the following result as an immediate corollary of Theorem 1.
Theorem 9. Let  $\delta \in (0,1)$ . Let  $1 \leq \hat{r} \leq T$  be the output of Algorithm 1 with input  $Z_{1},\ldots,Z_{T}$  and using the family  $\mathcal{F}$  described in this section. Let  $\hat{w} = \operatorname*{argmin}_{w:\|w\| \leq 1} \mathbb{P}_T^{\hat{r}}(L_w)$  be the linear classifier with minimum loss over the most recent  $\hat{r}$  samples. Then, with probability at least  $1 - \delta$ :
$$
P _ {T} (L _ {\hat {w}}) - P _ {T} (L _ {w ^ {*}}) = O \left(\min _ {r \leq T} \left[ \frac {1}{\sqrt {r}} + \max _ {t <   r} \| P _ {T} - P _ {T - t} \| _ {\mathcal {F}} + \sqrt {\frac {\log (\log (r + 1) / \delta)}{r}} \right]\right)
$$
where  $w^{*} = \operatorname{argmin}_{w: \| w \| \leq 1} P_{T}(L_{w})$  is the linear predictor with minimum loss with respect to the current distribution  $P_{T}$ .
Additional variants of learning with distribution drift have been studied in the literature. Freund and Mansour [1997] provide a refined learning algorithm in the special case of rapid distribution shift with a constant direction of change. In the work of Bartlett et al. [2000], they show specialized bounds in the case of infrequent changes and other different restrictions on the distribution drift. The work of Crammer et al. [2010] provides regret bound for online learning with an adversarial bounded drift. Yang [2011] studies the problem of active learning in a distribution drift setting. Hanneke et al. [2015] provide an efficient polynomial time algorithm to learn a class of linear separators with a drifting target concept under the uniform distribution in the realizable setting. Interestingly, they also show how to adapt their algorithm with respect to an unknown drift, although their technique relies on the realizability of the learning problem. In the more recent work of Hanneke and Yang [2019], they relax the independence assumption and provide learning guarantees for a sequence of random variables that is both drifting and mixing.
8 Conclusion, Limitations and Future Directions
We present a general learning algorithm that adapts to an unknown distribution drift in the training set. Unlike previous work, our technique does not require prior knowledge about the magnitude of the drift. For the problem of binary classification, we show that without explicitly estimating the drift, there exists an algorithm that learns a binary classifier with the same or better error bounds compared to the state-of-the-art results that rely on prior information about the magnitude of the drift. This is a major step toward practical solutions to the problem since prior knowledge about the distribution drift in the training set is often hard to obtain.
We presented concrete results for binary classification and linear regression, but our technique can be applied for learning any family of functions  $\mathcal{F}$  as long as it is possible to compute the distance  $\| \mathbb{P}_T^r -\mathbb{P}_T^{2r}\|_{\mathcal{F}}$  between the empirical distributions with  $r$  and  $2r$  samples according to the  $\| \cdot \|_{\mathcal{F}}$  norm (Assumption 2). This is often a challenging problem, and it is related to the computation of the discrepancy between distributions, which was studied in previous work on transfer learning [Mansour et al., 2009, Ben-David et al., 2010]. For binary classification, we assume that the empirical risk minimization problem is tractable. However, an exact solution to this problem is computationally hard for many hypothesis classes of interest, and this is a limitation of our algorithm and previous work on transfer learning. In those cases, we can modify our analysis to use the best-known approximation for the distance  $\| \mathbb{P}_T^r -\mathbb{P}_T^{2r}\|_{\mathcal{F}}$  as long as there is an approximation guarantee with respect to its exact value. As an illustrative example, if we have a procedure that returns an approximation  $E_{r}$  such that  $1\leq \| \mathbb{P}_T^r -\mathbb{P}_T^{2r}\|_{\mathcal{F}} / E_r\leq \alpha$  for any  $r\geq 1$ , then it is possible to change the algorithm to obtain a guarantee that is at the most a factor  $O(\alpha^2)$  worse than the one achieved by Algorithm 1 with the exact computation of the distance (we refer to Appendix B for additional details).
The method presented here uses a distribution-independent upper bound for the statistical error. While this upper bound can be tight in the worst-case, as shown in our lower bound for binary classification (Theorem 8), it can be loose for some other sequence of distributions. As a future direction, it is an interesting problem to provide an adaptive algorithm with respect to the drift that uses distribution-dependent upper bounds, for example, based on the Rademacher complexity, which can be possibly computed from the input data. Our algorithm does not naturally extend to this setting, as it requires knowing the rate at which the upper bound on the statistical error is decreasing (see proof of Proposition 4).
Acknowledgements. This material is based on research sponsored by Defense Advanced Research Projects Agency (DARPA) and Air Force Research Laboratory (AFRL) under agreement number FA8750-19-2-1006 and by the National Science Foundation (NSF) under award IIS-1813444. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of Defense Advanced Research Projects Agency (DARPA) and Air Force Research Laboratory (AFRL) or the U.S. Government.