diff --git a/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_content_list.json b/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..84f929be80a631c8930387a922e968906bdd7672 --- /dev/null +++ b/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5eac8b8896b8f283524d0e18b79e7d153f929622ac15a8acfb65cfc6e0d14ea6 +size 91529 diff --git a/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_model.json b/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2d2b8eaf98feb7612bc1000f87199f58c12c9016 --- /dev/null +++ b/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f29a0c59d16c9ab904f8a856bbdc948abc0d4efc4f3928be7a79c98c4fa4d04 +size 108860 diff --git a/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_origin.pdf b/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e2a5a2fef79205f97ff305aa50de5ed519b68f0a --- /dev/null +++ b/bestmodelidentificationarestedbanditformulation/dd4c76ba-d6f8-480f-ae4d-7d5c101b0692_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d60ceaec6062f9a5cfc5f55ee8f04a03ecac232c310c63409207e1db49b6a16f +size 366959 diff --git a/bestmodelidentificationarestedbanditformulation/full.md b/bestmodelidentificationarestedbanditformulation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..24998d4a591dd4d6c60aa17ba95461de9f21de9f --- /dev/null +++ b/bestmodelidentificationarestedbanditformulation/full.md @@ -0,0 +1,371 @@ +# Leonardo Cella1 Massimiliano Pontil12 Claudio Gentile3 + +# Abstract + +We introduce and analyze a best arm identification problem in the rested bandit setting, wherein arms are themselves learning algorithms whose expected losses decrease with the number of times the arm has been played. The shape of the expected loss functions is similar across arms, and is assumed to be available up to unknown parameters that have to be learned on the fly. We define a novel notion of regret for this problem, where we compare to the policy that always plays the arm having the smallest expected loss at the end of the game. We analyze an arm elimination algorithm whose regret vanishes as the time horizon increases. The actual rate of convergence depends in a detailed way on the postulated functional form of the expected losses. We complement our analysis with lower bounds, indicating strengths and limitations of the proposed solution. + +# 1. Introduction + +Multi-armed bandits are a mathematical framework of sequential decision problems that have played a fundamental role in machine learning and statistics (see e.g. Bubeck et al., 2012; Cesa-Bianchi, 2016; Lattimore & Szepesvári, 2020; Siegmund, 2003, and references therein). This framework consists of a sequence of $T$ interactions (or rounds) between a learning agent and an unknown environment. During each round the learner picks an action from a set of options $\mathcal{K}$ , usually referred to as arms, and the environment consequently generates a feedback (e.g., in the form of a loss value) associated with the chosen action/pulled arm. Multi-armed bandits have applications to a wide variety of domains including clinical trials, online advertising, and marketing. + +In the standard i.i.d. stochastic bandit setting (Auer et al., + +$^{1}$ Italian Institute of Technology, Genoa, Italy $^{2}$ University College London, United Kingdom $^{3}$ Google Research, New York, USA. Correspondence to: Leonardo Cella . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +2002), the feedback generated when pulling an arm is modeled as a random variable sampled from a prescribed distribution associated with the selected arm. In contrast, in this paper we are interested in a non-stationary stochastic bandit setting called rested bandits (Allesiardo et al., 2017; Besbes et al., 2014; Cella & Cesa-Bianchi, 2020; Kleinberg & Immorlica, 2018; Levine et al., 2017; Seznec et al., 2018), whereby the feedback/losses received upon pulling arms are not i.i.d. anymore. That is, the distribution of losses changes as a function of the number of times each arm has been pulled so far. As a relevant example, assume the expected loss of action $i \in \mathcal{K}$ at a given round is decreasing with time and takes the parametric form + +$$ +\frac {\alpha_ {i}}{\sqrt {\tau}} + \beta_ {i}, \tag {1} +$$ + +where $\tau$ is the number of times arm $i$ has been pull up to that round, and $\alpha_{i}$ and $\beta_{i}$ are unknown parameters. + +Considering decreasing expected losses is reasonable whenever the properties of the chosen arm improve as we allocate resources to them. For example, this is the case in scenarios where the goal is to find the best talent in a pool of candidates, say, the most valuable worker to train in an online labor platform having limited training time. + +Overall, we interpret this problem as an algorithm selection or selective training problem. In this scenario, an arm represents a learning device that satisfies Equation (1) (like a specific neural network architecture) and the goal is to keep training the learner that will be the best at the end of the game. The parameters $\alpha_{i}$ and $\beta_{i}$ in (1) may therefore quantify relevant properties of such models. For instance, in a standard statistical learning setting, parameter $\alpha_{i}$ can quantify the complexity (which may or may not be known) of the $i$ -th model class, $\beta_{i}$ might encode the representational power of that class in the form of the statistical risk of the best-in-class hypothesis (which is typically unknown), while the dependence on $1 / \sqrt{\tau}$ is meant to suggest a plausible behavior of the generalization error of the $i$ -th algorithm as a function of the training set size $\tau$ . Within this setting, an arm $i \in \mathcal{K}$ with small $\alpha_{i}$ and large $\beta_{i}$ may represent an empirical risk minimizer (ERM) operating on a simple model class where the ERM has an estimation error getting small with few samples, but which only underfits the data without effectively minimizing the approximation error. Conversely, an arm $i \in \mathcal{K}$ with large $\alpha_{i}$ and small $\beta_{i}$ may correspond + +to an ERM operating on a complex model class with large estimation error (where overfitting is likely to occur) and small approximation error. + +Given a budget of $T$ training samples, our specific goal is to design a strategy for online selective training, whereby at each round we have to decide which algorithm the next training example has to be fed to. This problem is of fundamental importance since, in many practical situations, performing a batch model selection (or model training) might be too computationally demanding. Thus, the goal is to design a strategy (a learning policy) that interacts with different learning algorithms with the goal of spending the budget of $T$ samples on the algorithm/model that is likely to perform best after training. Pulling an arm corresponds to feeding the current sample to the associated algorithm, while observing the feedback corresponds to being able to estimate in an approximate manner (e.g., on a separate test set) the generalization error of the trained algorithm for that arm, this error being a decreasing function of the number of samples the chosen algorithm has so far been trained over. Because the algorithms to select from may originate from different modeling assumptions, we also view this as a best model identification problem. + +Contributions. We first propose a novel notion of regret which is suited to the online learning problem we consider here. This regret criterion frames our problem as a best arm identification problem within a rested bandit scenario. We then characterize the structure of the problem by proving a non-asymptotic lower bound restricted to the 2-arm case. Finally, we propose two action elimination algorithms, and show for one of the two algorithms a regret upper bound that essentially matches the above-mentioned lower bound. + +Notation. For a integer $N > 0$ , we abbreviate the set $\{1, \dots, N\}$ by $[N]$ . We use $\mathbb{E}[\cdot]$ and $\mathbb{P}[\cdot]$ , to denote expected value and probability measure, respectively. Moreover, for a given $\sigma$ -algebra $\mathcal{F}$ , $\mathbb{E}_{\mathcal{F}}[\cdot]$ and $\mathbb{P}_{\mathcal{F}}[\cdot]$ denote their conditional counterparts. + +# 2. Related works + +Our problem can be seen as a (rested variant of) the best arm identification problem, in that our metric reminds the simple-regret that was previously designed for the best-arm identification problem in the standard (stationary) stochastic multi-armed bandit setting (e.g. Even-Dar et al., 2006; Audibert & Bubeck, 2010; Gabillon et al., 2012; Kaufmann et al., 2016). The best arm identification problem has been investigated from two slightly different viewpoints. In the so called fixed-confidence variant, the goal is to minimize the sample complexity (that is, the number of pulls) needed to guarantee that, with some fixed confidence level, the selected arm is the one with smallest expected loss. In the + +fixed-budget variant, the goal is to find the best-arm within a fixed number of rounds (budget), while minimizing the probability of error. + +In our case, we want the learning algorithm to single out with high probability (fixed confidence) the best base learner but, due to the non-stationary nature of the expected loss of base learners, we also want to do so with as few pulls as possible. Hence, we are in a sense combining the two criteria of fixed confidence and fixed budget. + +A problem which is similar in spirit to ours is that of online model selection in bandit settings (that is, the case where the base learners are themselves bandit algorithms). This has been investigated in a number of papers in recent years, e.g., (Agarwal et al., 2017; Foster et al., 2019; 2020; Pacchiano et al., 2020; Cutkosky et al., 2021). In particular Agarwal et al. (2017) consider a very general class of base learners which have to satisfy reasonable stability assumptions. In order to deal with bandit information, importance weighted feedback is given to the bandit learners. In (Foster et al., 2019; 2020) the emphasis is specifically on linear bandit model selection problems, where model selection operates on the input dimension (Foster et al., 2019) or the amount of misspecification (Foster et al., 2020). Similar to (Agarwal et al., 2017), in (Pacchiano et al., 2020) the authors investigate the problem of algorithm selection in contextual bandits where contexts are stochastic. In order to bypass the stability assumption in (Agarwal et al., 2017), an additional smoothed transformation is introduced. The positive side effect induced by this additional step is the ability to feed the base learners with the original feedback with no re-weighting. + +Unlike all the above works, we assume the expected loss of the base learners (which are not limited to bandit policies) depends in specific ways on the number of times each base learner is selected, this dependence being known up unknown parameters that have to be estimated. More importantly, we investigate a performance metric that is different from the standard cumulative regret incurred with respect to the best allocation policy, as studied in (Agarwal et al., 2017; Foster et al., 2020; 2019; Pacchiano et al., 2020). Further remarks on this comparison is given in the next section. + +A different stream of literature, which is loosely related to our work, is hyperparameter optimization; see (Li et al., 2017) for a representative example. The main difference with our setting is that, besides the standard exploration-exploitation trade-off, here we also have to deal with a trade-off induced by non-stationarity. Hyperparameter optimization algorithms like the one in (Li et al., 2017) adaptively searches in the space of hyperparameters, and the goal is akin to best arm identification. Yet, the feedback is assumed to be stationary, since hyperparameter values do not correspond to stateful objects (as in the case of our + +base learners), and hyperparameter configurations are usually evaluated on a separate validation set. An adversarial variant of hyperparameter optimization was considered in (Jamieson & Talwalkar, 2016), but their notion of regret is different from ours. + +In the bandits literature, there are two standard ways of modeling non-stationarity: restless (Whittle, 1988; Tekin & Liu, 2012; Ortner et al., 2014; Russac et al., 2019) and rested (Levine et al., 2017; Mintz et al., 2017; Kleinberg & Immoralica, 2018; Seznec et al., 2018; Pike-Burke & Grunewalder, 2019; Cella & Cesa-Bianchi, 2020; Kolobov et al., 2020) bandits. In the restless case, the non-stationary nature of the feedback is determined only by the environment, and the learning policies either try to detect changes in the payoff distribution in order to restart the learning model, or to apply a weight-decay scheme to the collected observations. On the contrary, in rested bandits, the non-stationarity depends on the learning policy itself. For instance, in (Cella & Cesa-Bianchi, 2020; Kleinberg & Immoralica, 2018; Kolobov et al., 2020; Pike-Burke & Grunewalder, 2019), an arm expected payoff distribution is parametrized by the elapsed time since that arm was last pulled. The main leverage given to the proposed solutions is the possibility of observing more unbiased samples corresponding to a fixed arm-delay pair. This simplifies the parameter estimation problem. Similar to the setting we are proposing, in (Levine et al., 2017; Seznec et al., 2018) the authors assume the expected loss of an arm to be monotonically increasing in the number of times the arm was pulled. The striking difference is that, in their variant, a simple greedy solution which at each round selects the currently-best arm is actually an optimal solution. Therefore, their learning problem reduces to estimating for each arm the expected loss corresponding to its next pull and always select the most promising one. In our setting (see Section 3 below), because expected losses are decreasing, a similar solution would be far from optimal, since our objective is to identify the arm minimizing the resulting loss at the end of the game. + +# 3. Learning setting + +We consider a set of $K$ arms (or learning agents) $\mathcal{K} = [K] = \{1,\dots ,K\}$ , whose average performance improves as we play them. At each round $t\in [T]$ , the learner picks an arm $I_{t}\in \mathcal{K}$ and observes the realization $X_{I_t,t}$ of a loss random variable whose (conditional) expectation $\mu_{I_t,t}$ is a decreasing function of the number of times arm $I_{t}$ has been pulled so far. Specifically, for any $i\in \mathcal{K}$ and $t\in [T]$ , denote by $\tau (i,t)$ the number of times arm $i$ has been pulled up to time $t$ , and by $\mathcal{F}_t$ the $\sigma$ -algebra generated by the past history of pulls and loss random variables $I_1,X_{I_1,1},\ldots ,X_{I_{t - 1},t - 1}$ . Given a time horizon $T$ , a learning policy $\pi$ is a function that maps at each time $t\in [T]$ the observed history + +$I_{1},X_{I_{1},1},\ldots ,I_{t - 1},X_{I_{t - 1},t - 1}$ to the next action $I_{t}\in \mathcal{K}$ At the end of round $T$ policy $\pi$ has to commit to (or to output) a given action $i_{\mathrm{out}}\in \mathcal{K}$ .We define + +$$ +\mu_ {i, t} \equiv \mathbb {E} _ {\mathcal {F} _ {t}} \left[ X _ {i, t} \right] = \frac {\alpha_ {i}}{\left(1 + \tau (i , t - 1)\right) ^ {\rho}} + \beta_ {i}, \tag {2} +$$ + +where exponent $\rho \in (0,1]$ is a known parameter common to all arms while, for all arms $i\in \mathcal{K}$ , scaling parameter $\alpha_{i}$ and position parameter $\beta_{i}$ are assumed to be non-negative but unknown to the learning algorithm. We assume $\alpha_{i}\in [0,U]$ and $\beta_{i}\in [0,1]$ , where the upper extreme $U$ is a known quantity. Hence, $\mu_{i,t}$ is the expected loss of arm $i$ at round $t$ , conditioned on the fact that $i$ has already been played $\tau (i,t - 1)$ times during the previous $t - 1$ rounds. + +As a shorthand, from now on we will use $\mu_i(\tau)$ to denote the expected loss of arm $i\in \mathcal{K}$ if pulled so far $\tau \in [T]$ times. Notice that when $\alpha_{i} = 0$ for all $i\in \mathcal{K}$ our setting reduces to the standard stochastic multi-armed bandit setting (e.g. (Auer et al., 2002)).1 It is the decaying component $\frac{\alpha_i}{(1 + \tau(i,t - 1))^{\rho}}$ that makes this setting an instance of the rested bandit setting, where the stochastic behavior of the arms depends on the actual policy $I_{1},\ldots ,I_{t - 1}$ that has so far been deployed during the game. + +We compare a learning policy $\pi$ to the optimal policy that knows all parameters $\{\alpha_{i},\beta_{i}\}_{i\in \mathcal{K}}$ in advance, and pulls from beginning to end the arm $i_T^*$ whose expected loss at time $T$ is smallest, i.e., + +$$ +i _ {T} ^ {*} = \arg \min _ {i \in \mathcal {K}} \left(\frac {\alpha_ {i}}{T ^ {\rho}} + \beta_ {i}\right). +$$ + +We define the pseudo regret of $\pi$ after $T$ rounds as + +$$ +R _ {T} ^ {\pi} (\underline {{\mu}}) = \mu_ {i _ {\text {o u t}}} \left(\tau_ {\text {o u t}}\right) - \mu_ {i _ {T} ^ {*}} (T), \tag {3} +$$ + +where $\tau_{\mathrm{out}} = \tau (i_{\mathrm{out}},T)$ is the random variable counting the number of pulls of arm $i_{\mathrm{out}}\in \mathcal{K}$ after $T$ rounds. In the above, $\underline{\mu}\in \{\mu_i:[T]\to [0,1]\}_{i\in \mathcal{K}}$ collectively denotes the non-stationary environment generating the observed losses. Our goal is to bound pseudo-regret $R_T^\pi (\underline{\mu})$ with high probability, where the probability is w.r.t. the random draw of variables $X_{i,t}$ (and possibly the random choice of $I_{1},\ldots ,I_{T}$ and $i_{\mathrm{out}}$ ). Notice that $R_T^\pi (\underline{\mu})$ is always non-negative. + +A closer inspection of Eq. (3) reveals that, unlike standard best-arm identification problems (e.g., (Even-Dar et al., 2006; Audibert & Bubeck, 2010; Gabillon et al., 2012; Kaufmann et al., 2016)), our objective here is not limited to predicting which arm is best at the end of the game, but also to pull it as much as we can, that is, to single it out as early as possible. This also entails that if the arm our policy $\pi$ pulls the most throughout the $T$ rounds is $i \neq i_T^*$ , + +then it may be better for $\pi$ to output $i_{\mathrm{out}} = i$ rather than $i_T^*$ itself, even if $\pi$ gets to know at some point the identity of $i_T^*$ and starts pulling it from that time onward. This is because if, say, for some $t_0$ close to $T$ we have $\tau (i,t_0) = t_0$ and $\tau (i_T^*,t_0) = 0$ , then we may well have $\mu_{i,t_0} < \mu_{i_T^*,T - t_0}$ so that (3) is smaller for $i_{\mathrm{out}} = i$ than for $i_{\mathrm{out}} = i_T^*$ . In order to gather further insights, it is also worth considering the simple policy $\pi$ which selects all arms $T / K$ times, and then outputs the best arm $i_T^*$ . According to Eq. (3), $\pi$ will still suffer significant regret, since it did not play $i_T^*$ often enough throughout the $T$ rounds (that is, $\pi$ has explored "too much" on sub-optimal arms). We can thus claim that, thanks to the presence of the $\tau_{\mathrm{out}}$ variable, our regret in (3) is only seemingly non-cumulative. + +Finally, observe that the average loss $\mu_{i,t}$ in (2) can be expressed as the linear combination $\mu_{i,t} = x_t^\top \theta_i^*$ , where $\theta_i^* = [\alpha_i,\beta_i]^\top$ is the unknown vector associated with arm $i$ , and $x_{t} = [1 / \tau (i,t - 1)^{\rho},1]^\top$ is the "context" vector at time $t$ . This might give the impression of some kind of linear contextual bandit (e.g., (Soare et al., 2014)) in the best arm identification regime. Yet, this impression is erroneous, since in our problem $x_{t}$ is itself generated by the learning policy during its online functioning. + +In the sequel, we also adopt the notion of state $\underline{\tau} = (\tau_1,\tau_2,\dots \tau_K)\in [T]^K$ to encode the case where, for all $i\in \mathcal{K}$ , arm $i$ has been pulled $\tau_{i}$ times. Notice that when the learning policy is at state $(\tau ,\ldots ,\tau)$ , keep sampling all arms in a round-robin fashion (exploring) entails observing $K$ many samples with expected value $\mu_1(\tau),\dots ,\mu_K(\tau)$ respectively, and ending up into state $(\tau +1,\dots ,\tau +1)\in [T]^K$ . Conversely, when the learning policy is at state $(\tau ,\dots ,\tau)$ , then keep pulling the same arm $i\in \mathcal{K}$ for the remaining $T - K\tau$ rounds (exploiting) corresponds to reaching the furthest still reachable state where arm $i$ (which will then be the most pulled one) will have expected loss $\mu_i(T - (K - 1)\tau)$ . + +On the comparison to Bandit Model Selection. The reader may wonder to what extent our task is similar to the bandit model selection problem (Agarwal et al., 2017; Foster et al., 2019; 2020; Pacchiano et al., 2020; Cutkosky et al., 2021) we alluded to in the related works section. At a high-level, this question is similar to the difference between best-arm identification (BAI) and regret minimization (RM). We can coarsely claim that the cited papers correspond to the generalization to stateful arms of RM, while here we generalize BAI to stateful arms having a specific parametric form of their losses. In fact, we cannot easily compare to bandit model selection, since our problem is substantially different. To see why, consider two base learners (say, two students) whose expected loss curves intersect just at time $T - 1$ . The first one has $\alpha_{1} = 0$ and $\beta_{1} > 0$ (not improving over time but looking promising at the beginning), the + +second one has $\alpha_{2} > 0$ and $\beta_{2} = 0$ (lagging behind at the beginning, but able to ramp up faster over time). In our BAI setting, the optimal policy would stick to arm 2 since $\mu_{2}(T) < \mu_{1}(T)$ , while an RM policy would clearly seek to play arm 1. This also helps elucidate the key role played by $T$ : As $T \to \infty$ arm 2 becomes more attractive even in the RM sense, while if we stop earlier, say $T / 2$ (so that the two loss curves no longer intersect), then arm 1 becomes better also in our BAI setting. All in all, in our setting one has to depart from the general idea, quite common in RM, of studying regret "for large $T$ (or even "for large $K$ ), since the complex interplay among problem parameters makes these investigations less meaningful than in RM. Observe that, as $T \to \infty$ our setting turns to standard stationary BAI, since $\mu_{i,t} \rightarrow \beta_{i}$ in Eq. (2). Hence, what matters here is the case when $T$ is not large. + +# 4. Main trade-offs and lower bound + +In this section we provide a distribution-dependent lower bound for the proposed setting. This will also give us the chance to comment on the specific features of our learning task in terms of the main trade-offs a learning policy has to face. We start by defining the class of arm-elimination policies as those which periodically remove sub-optimal arms and keep sampling in a round-robin fashion2 the remaining arms across the rounds. The following simple fact holds. + +Fact 1. The regret incurred by an arbitrary policy $\pi$ is invariant to permutations of the chronological order of its actions. In fact, (3) only depends on the arm $i_{\mathrm{out}}$ selected at the end, and the number of times $\tau_{\mathrm{out}}$ that arm has been chosen during the $T$ rounds. Hence, for any $\pi$ , there exists an arm-elimination policy $\pi'$ whose regret is not worse (i.e., having the same pair $i_{\mathrm{out}}, \tau_{\mathrm{out}}$ ). + +Proof. Let for simplicity $K = 2$ : (i) Since expected losses (2) decrease with the number of pulls, it is easy to see that the best thing a policy can do so as to minimize regret (3) is to decide as early as possible which arm to commit to, pull that arm from that point on, and output it as $i_{\mathrm{out}}$ . Any deviation from this results in higher regret. (ii) In the initial stage before commitment, the best thing a policy can do is to equalize the number of pulls of the two arms (hence the round-robin sampling of an arm-elimination policy). Any deviation from this equalization strategy can be penalized by the adversary generating parameters $(\alpha_i, \beta_i)$ : if we pull arm 1 more than arm 2 the adversary may have made 2 the optimal arm at the time we commit, and vice versa. + +We can therefore restrict our lower bound investigation to arm-elimination policies. An advantage of this restriction is a more convenient characterization of the state space $\{\underline{I}\}$ + +![](images/8f129616029838c6f5c663a5beb29a28def4ccc2d213e6e2b6f3f482f4c3cd5b.jpg) +Figure 1. Expected losses associated with the arms in Example 1. + +associated with the learning problem. The size of the state space is clearly of the form $T^K$ . + +Another relevant aspect of our problem is that, based on (2) and (3), for each given state $(\tau_{1},\dots,\tau_{K})\in [T]^{K}$ , there are at most $K$ many candidate optimal and still reachable states that any policy could end up to. These are specifically the $K$ alternative states that the learning policy at hand would reach by committing to one of the $K$ arms for all the remaining rounds. All other states (which are exponential many) can easily be seen to be sub-optimal. + +Before moving to the main result of this section (the regret lower bound), we would like to give an additional characterization of the considered class of policies. The missing component which gives a well-specified policy is the condition governing the arm elimination. Since expected losses (2) are non-increasing, and given the regret criterion (3), once a policy is confident that sticking to an arm would give a smaller expected loss than the one associated with the last pull, this policy might be tempted to eliminate all the other arms. In the next example we show that operating this way can be sub-optimal. + +Example 1. Let us consider the specific instance of our problem with $K = 2$ arms whose expected losses are sketched in Figure 1. Whereas the first arm is stationary $\mu_1(\tau) = \beta_1$ , the second is not, $\mu_2(\tau) = \frac{\alpha_2}{\tau^\rho} + \beta_1$ . At state $\underline{\tau}_1 = (\tau_1, \tau_1)$ it may occur that the $\tau_1$ observations associated with arm 2 are enough to realize that $\mu_2(T - \tau_1) < \mu_2(\tau_1)$ . Hence the learning policy knows that if it kept sampling arm 2 for the remaining $T - 2\tau_1$ pulls it would achieve a smaller (expected) loss compared to $\mu_2(\tau_1)$ . The same would not hold for the other arm, as it is stationary. + +Let us now denote by $\tau_{2}$ the number of pulls it takes to figure out that $\beta_{1} < \mu_{2}(T - \tau_{2})$ . It could be the case that $\tau_{2} > \tau_{1}$ (that is, as in Figure 1, we have $\mu_{2}(T - \tau_{2}) - \beta_{1} < \mu_{2}(\tau_{1}) - \mu_{2}(T - \tau_{1})$ ). In order to maximize $\tau_{\mathrm{out}}$ (so as to minimize regret (3)) a naive policy might eliminate arm 1 after $\tau_{1}$ observations. This would translate into choosing the wrong value of $i_{\mathrm{out}}$ , hence clearly incurring a regret. Conversely, a smarter policy that keeps exploring up to state + +$(\tau_{2}, \tau_{2})$ would return $i_{\mathrm{out}} = 1$ and yield $\tau_{\mathrm{out}} = T - \tau_{2}$ . Notice that, thanks to the stationary nature of the optimal arm, the regret incurred by this policy is indeed zero. + +All in all, the above observations help better understand the structure of our problem, which will be useful in all technical proofs (see the appendix). We can now turn our attention to the lower bound. In doing so, we generalize the results in (Bubeck et al., 2013), which in turn adopts a hypothesis testing argument that hinges on a lower bound for the minimax risk of hypothesis testing (ee e.g. Tsybakov, 2008, Ch. 2). Notice that the classical lower bound result for stationary bandits (Lai & Robbins, 1985) cannot easily be adapted here since, being asymptotic in nature, that result tends to lose the non-stationary component of our expected losses (2), and thus the cumulated effect of this non-stationarity on the $\tau_{\mathrm{out}}$ variable. + +As done in (Bubeck et al., 2013), for all arms and all possible number of pulls, we consider all families of loss distributions $\{\mathbb{P}_{\mu}\}$ , indexed by their expected value $\mu$ , and such that $KL(\mathbb{P}_{\mu}, \mathbb{P}_{\mu'}) = C(\mu - \mu')^2$ for some absolute constant $C > 0$ (e.g., in the case of normal distributions, $KL(\mathcal{N}(\mu, \sigma), \mathcal{N}(\mu', \sigma)) = \frac{1}{2} (\mu - \mu')^2$ ). In the sequel, we use $\tau_{\mathrm{sub}} = T - \tau_{\mathrm{out}}$ to denote the number of rounds spent by pulling all arms different from $i_{\mathrm{out}}$ . Additionally, we denote by $\mathbb{P}_{\underline{\mu}(\tau)} = \mathbb{P}_{\mu_1(\tau)} \otimes \ldots \otimes \mathbb{P}_{\mu_K(\tau)}$ the product distribution that generates the losses from $\mathbb{P}_{\mu_i(\tau)}$ when pulling arm $i \in \mathcal{K}$ for the $\tau$ -th time. The result that follows restricts to the two arm case, $^3$ and delivers a bound on the regret that holds in expectation over the loss random draws. + +Theorem 1. Let $\mathbb{P}_{\underline{\mu} (\tau)} = \mathbb{P}_{\mu_1(\tau)}\otimes \mathbb{P}_{\mu_2(\tau)}$ be defined by distributions whose expected values are $\mu_{1}(\tau) = \frac{\alpha_{1}}{\tau^{\rho}} +\beta$ and $\mu_{2}(\tau) = \frac{\alpha_{2}}{\tau^{\rho}} +\beta +\Delta$ , respectively, where $\Delta >0$ is an unknown but fixed constant. Additionally, let $\mathbb{P}_{\underline{\mu}'(\tau)} = \mathbb{P}_{\mu_1'(\tau)}\otimes \mathbb{P}_{\mu_2'(\tau)}$ be another product distribution, whose expected value components are $\mu_1^\prime (\tau) = \mu_1(\tau)$ and $\mu_2^\prime (\tau) = \mu_1(\tau) - \Delta$ . Then, for any policy $\pi$ , and any horizon $T\geq 1$ , the quantity max{E[Rr(μ)],E[Rr(μ')]} can be lower bounded by + +$$ +\left\{ \begin{array}{l l} \mu_ {2} (T - \tau_ {\mathrm {s u b}}) - \mu_ {i _ {T} ^ {*}} (T) & i f T - \tau_ {\mathrm {s u b}} \leq \lceil \overline {{\tau}} \rceil , \alpha_ {1} > \alpha_ {2} \\ \mu_ {1} (T - \tau_ {\mathrm {s u b}}) - \mu_ {i _ {T} ^ {*}} (T) & i f T - \tau_ {\mathrm {s u b}} \geq \lceil \overline {{\tau}} \rceil , \alpha_ {1} > \alpha_ {2} \\ \alpha_ {1} \left(\frac {1}{(T - \tau_ {\mathrm {s u b}}) ^ {\rho}} - \frac {1}{T ^ {\rho}}\right) & i f \alpha_ {1} \leq \alpha_ {2} , \end{array} \right. +$$ + +where $\overline{\tau} = \left(\frac{\alpha_1 - \alpha_2}{\Delta}\right)^{\frac{1}{\rho}}$ satisfies $\mu_{1}(\overline{\tau}) = \mu_{2}(\overline{\tau})$ . We also have $i_T^* = \{1\}$ if $\overline{\tau} < T$ and $i_T^* = \{2\}$ otherwise. Finally, + +$\tau_{\mathrm{sub}}$ is the smallest $\tau \in [T / 2]$ which is strictly larger than + +$$ +\begin{array}{l} \min \left\{\frac {1}{8 C \Delta_ {\tau} ^ {2}} \log \left(C \Delta_ {\tau} ^ {2} \tau / 4\right), \frac {1}{8 C \widetilde {\Delta} _ {1 , \tau} ^ {2}} \log \left(C \widetilde {\Delta} _ {1, \tau} ^ {2} \tau / 4\right), \right. \\ \left. \frac {1}{8 C \widetilde {\Delta} _ {2 , \tau} ^ {2}} \log \left(C \widetilde {\Delta} _ {2, \tau} ^ {2} \tau / 4\right) \right\}, \\ \end{array} +$$ + +where $\Delta_{\tau} = \mu_1(\tau) - \mu_2(\tau)$ and $\widetilde{\Delta}_{i,\tau} = \mu_i(T - \tau - 1) - \mu_i(T - \tau)$ . + +The proof is given in the appendix. The main idea behind it is that under the assumptions of Theorem 1, we have two quantities characterizing the lower bound on the number of sub-optimal pulls $\tau_{\mathrm{sub}}$ . The first one is associated with $i_{\mathrm{out}}$ , and is of order $1 / \Delta_{\tau}^{2}$ . The second one is induced by the objective of minimizing the incurred expected loss at $\tau_{\mathrm{out}}$ and is of order $1 / \widetilde{\Delta}_{i,\tau}^{2}$ . The main point here is that exploring towards arm $i_{\mathrm{out}}$ is worthwhile only if it does not cause a higher incurred loss $\mu_{i_{\mathrm{out}}}(\tau_{\mathrm{out}})$ . The second ingredient is specified by relation between $\alpha_{1}$ and $\alpha_{2}$ . In fact, if $\alpha_{1} \leq \alpha_{2}$ we have that the second arm's expected loss $\mu_{2}(\tau)$ is always worse than the one of the first, if considered at the same number of pulls $\tau$ . On the other hand, if $\alpha_{1} > \alpha_{2}$ their order relation depends on $\overline{\tau}$ . + +We would like to emphasize that even when $\alpha_{1} = \alpha_{2}$ , the horizon $T$ is large enough, and $\Delta \rightarrow 0$ (that is, the two arms are less and less statistically distinguishable), an optimal strategy for our regret minimization problem is by no means to pull both arms an equal $(T / 2)$ number of times. Rather, an optimal strategy would commit to one of the two arms as soon as it is confident enough on which of them has the smaller loss (at any reachable state), unless trying to determine the best arm causes a bigger regret than immediately committing to any of the two. The quantity $\tau_{\mathrm{sub}}$ (at least in the two-arm case) will play a key role in characterizing the statistical complexity of our learning problem. + +# 5. Estimation of parameters + +In order to minimize the regret $R_T^\pi(\underline{\mu})$ , any reasonable policy $\pi$ has to be able to estimate, for all arms $i \in \mathcal{K}$ , the associated expected loss $\mu_i(\cdot)$ , and it has to do so at any still reachable state where arm $i$ will be pulled $\tau_{\mathrm{out}}$ times. To this effect, we now introduce two statistically independent estimators. Upon pulling arm $i \in \mathcal{K}$ for $2\tau$ times, we define + +$$ +\widehat {X} _ {i, \tau} = \frac {1}{\tau} \sum_ {s = 1} ^ {\tau} X _ {i} (s), \quad \widetilde {X} _ {i, \tau} = \frac {1}{\tau} \sum_ {s = \tau + 1} ^ {2 \tau} X _ {i} (s), \quad (4) +$$ + +where $X_{i,s}$ denotes the loss incurred by arm $i$ after having pulled it $s$ times $(\mathbb{E}[X_{i,s}] = \mu_{i,s})$ . Notice, that due to the way we have defined $\mu_{i,s}$ , the above estimators are empirical averages of independent but non-identically distributed + +random variables, the independence deriving from the fact that pulling one arm does not influence the distribution of the others. Moreover, because of the time decay, the expectation of $\widehat{X}_{i,\tau}$ cannot be smaller than the one of $\widetilde{X}_{i,\tau}$ . + +We combine these two estimators together with standard concentration inequalities to derive a joint estimator for $(\alpha_{i},\beta_{i})$ . Since the two estimators are non-redundant, this allows us to come up with estimators for $\alpha_{i}$ and $\beta_{i}$ individually. Using Bernstein's inequality, we can derive confidence bounds around $\widehat{X}_{i,\tau}$ and $\widetilde{X}_{i,\tau}$ as functions of $\beta_{i}$ and $\alpha_{i}$ . Specifically, for each arm $i\in \mathcal{K}$ , number of pulls $2\tau \in [T]$ , the expectation $\mathbb{E}[\widehat{X}_{i,\tau}]$ is contained with probability at least $1 - \delta$ in the interval $[\widehat{X}_{i,\tau} - \mathrm{CB}_{\widehat{X},\tau}(\delta),\widehat{X}_{i,\tau} + \mathrm{CB}_{\widehat{X},\tau}(\delta)]$ where + +$$ +\mathbf {C B} _ {\widehat {X}, \tau} (\delta) = \left(\sqrt {U} + 1\right) ^ {2} \sqrt {\frac {2}{\tau} \log \frac {1}{\delta}} + \frac {(U + 1) \log \frac {1}{\delta}}{\tau}. +$$ + +A similar argument follows for $\mathbb{E}[\widetilde{X}_{i,\tau}]$ and $\mathrm{CB}_{\widetilde{X},\tau}(\delta)$ . We defer to the appendix the details of the exact expression for the confidence intervals. Starting from these definitions we can build the following set of inequalities + +$$ +\mathbb {E} \left[ \widehat {X} _ {i, \tau} \right] - \mathbf {C B} _ {\widehat {X}, \tau} (\delta) \leq \widehat {X} _ {i, \tau} \leq \mathbb {E} \left[ \widehat {X} _ {i, \tau} \right] + \mathbf {C B} _ {\widehat {X}, \tau} (\delta) +$$ + +$$ +\mathbb {E} [ \widetilde {X} _ {i, \tau} ] - \mathbf {C B} _ {\widetilde {X}, \tau} (\delta) \leq \widetilde {X} _ {i, \tau} \leq \mathbb {E} [ \widetilde {X} _ {i, \tau} ] + \mathbf {C B} _ {\widetilde {X}, \tau} (\delta) +$$ + +which can be solved for $\alpha_{i}$ and $\beta_{i}$ individually. As shown in the appendix, this gives rise to the following confidence intervals for $\alpha_{i}$ : + +$$ +\begin{array}{l} \alpha_ {i} \in \overbrace {\frac {\tau \Delta \widehat {X} _ {i , \tau}}{\sum_ {s = 1} ^ {\tau} \frac {1}{s ^ {\rho}} - \sum_ {s = \tau + 1} ^ {2 \tau} \frac {1}{s ^ {\rho}}}} ^ {\widehat {\alpha} _ {i, \tau}} \pm \\ \pm \frac {5 \tau^ {\rho} (\sqrt {U} + 1) ^ {2}}{\rho} \left[ \frac {\log 1 / \delta}{\tau} + \sqrt {\frac {1}{\tau} \log \frac {1}{\delta}} \right], \tag {5} \\ \end{array} +$$ + +where $\Delta \widehat{X}_{i,\tau} = \widehat{X}_{i,\tau} - \widetilde{X}_{i,\tau}$ . For brevity, the confidence interval centroid will be denoted by $\widehat{\alpha}_{i,\tau}$ . Similarly, $\beta_{i}$ can be shown to satisfy + +$$ +\begin{array}{l} \beta_ {i} \in \overbrace {\widehat {X} _ {i , \tau} - \frac {\widehat {\alpha} _ {i , \tau}}{\tau} \sum_ {s = 1} ^ {\tau} \frac {1}{s ^ {\rho}}} ^ {\widehat {\beta} _ {i, \tau}} \pm \\ \frac {5 (\sqrt {U} + 1) ^ {2}}{(1 - \rho) \rho} \left[ \frac {\log 1 / \delta}{\tau} + \sqrt {\frac {1}{\tau} \log \frac {1}{\delta}} \right], \tag {6} \\ \end{array} +$$ + +where $\widehat{\beta}_{i,\tau}$ denotes the centroid of confidence interval (6). Despite we have provided separate estimators for $\alpha_{i}$ and $\beta_{i}$ , it is important to stress that our interest here is not to estimate them separately. Combining these estimators gives + +$$ +\widehat {\mu} _ {i, \tau} (\tau_ {\mathrm {o u t}}) = \frac {\widehat {\alpha} _ {i , \tau}}{\tau_ {\mathrm {o u t}} ^ {\rho}} + \widehat {\beta} _ {i, \tau}, +$$ + +an estimate of the expected loss incurred by arm $i \in \mathcal{K}$ as if we had pulled it $\tau_{\mathrm{out}}$ times after having observed only $2\tau$ realizations of $X_{i,t}$ . All the above can be summarized by the following theorem. + +Theorem 2. After observing $X_{i,1},\ldots ,X_{i,2\tau}$ loss realizations of arm $i\in \mathcal{K}$ , we can predict the expected loss $\mu_{i,\tau_{\mathrm{out}}}$ of arm $i$ as it were pulled $\tau_{\mathrm{out}}$ -many times (with $\tau_{\mathrm{out}} > \tau$ ). In particular, we have that with probability at least $1 - \delta$ jointly over $i\in \mathcal{K}$ , $\tau \in [T]$ and $\tau_{\mathrm{out}}\in [T]$ , + +$$ +\widehat {\mu} _ {i, \tau} (\tau_ {\mathrm {o u t}}) - C B _ {\mu , \tau} (\delta) \leq \mu_ {i, \tau_ {\mathrm {o u t}}} \leq \widehat {\mu} _ {i, \tau} (\tau_ {\mathrm {o u t}}) + C B _ {\mu , \tau} (\delta), +$$ + +where + +$$ +\mathrm {C B} _ {\mu , \tau} (\delta) = \frac {1 0 \left(\sqrt {U} + 1\right) ^ {2}}{(1 - \rho) \rho} \left[ \frac {\log \frac {\tau K T}{\delta}}{\tau} + \sqrt {\frac {1}{\tau} \log \frac {\tau K T}{\delta}} \right]. +$$ + +Hence, the approach contained in Theorem 2 allows us to obtain confidence intervals for $\mu_{i,\tau_{\mathrm{out}}}$ shrinking with $\tau$ as $\frac{1}{\sqrt{\tau}}$ up to a numerical constant depending on $\rho$ and $U$ . + +Finally, observe that these confidence intervals are non-vacuous only when $\rho \in (0,1)$ , that is, excluding the extreme cases $\rho = 0$ and $\rho = 1$ . The case $\rho = 0$ is indeed uninteresting, since it yields a stationary case which is equivalent to the one achieved by the setting $\alpha_{i} = 0$ for all $i$ . In fact, due to the specific nature of the empirical averages in (4), when $\rho = 0$ the centroid $\widehat{\alpha}_{i,\tau}$ occurring in (5) is not well defined, independent of the number of observed samples $\tau$ . On the other hand, because our derivations rely on approximations of the form $\sum_{s=1}^{\tau} \frac{1}{s^{\rho}} \approx \frac{s^{1 - \rho}}{1 - \rho}$ , which only hold for $\rho \neq 1$ , the case $\rho = 1$ should be treated separately via standard approximations of the form $\sum_{s=1}^{\tau} \frac{1}{s} \approx \log \tau$ . + +The above estimators will be the building blocks of our learning algorithms, presented in the next section. In particular, the definition of $CB_{\mu,\tau}(\delta)$ given in Theorem 2 above will be repeatedly used throughout the rest of the paper. + +# 6. Regret minimization + +In this section we present two learning policies. We first describe as a warm-up a simple explore-then-commit strategy, then we present a more sophisticated strategy inspired by the Successive Reject algorithm (Audibert & Bubeck, 2010). For both policies, we set the confidence parameter $\delta$ to $\frac{1}{T}$ . + +The first solution we propose is a rested bandit variant of the standard explore-then-commit (ETC) policy (e.g. Lattimore & Szepesvári, 2020, Ch. 6)). In its original formulation, ETC requires as input a parameter $n \in [T]$ specifying the number of initial pulls associated with each arm. Once all the arms have been pulled $n$ times, the exploratory phase finishes. The original ETC algorithm then sticks to the most + +# Algorithm 1 Explore-Then-Commit (ETC) + +Require: Confidence parameter $\delta = 1 / T$ + +1: for $n \in 1, \ldots, \lfloor T / K \rfloor$ do +2: pull each arm once +3: $\tau_{\mathrm{out}} = T - n(K - 1)$ +4: if $\exists i\in \mathcal{K}$ .. $\widehat{\mu}_{i,n}(\tau_{\mathrm{out}}) < \min_{j\in \mathcal{K}\setminus \{i\}}\widehat{\mu}_{j,n}(\tau_{\mathrm{out}}) -$ $2CB_{\mu ,n}(\delta)$ then +5: $i_{\mathrm{out}} = \arg \min_{i\in \mathcal{K}}\widehat{\mu}_{i,n}(\tau_{\mathrm{out}})$ +6: break; {The exploration phase terminates} +7: end if +8: end for +9: Play $i_{\mathrm{out}}$ until round $T$ {Commit} +10: Output $i_{\mathrm{out}}$ + +promising arm according to the estimates computed during the exploration. Hence the two phases of exploration and exploitation are kept separate. This strategy has a clear limitation. Since the exploration parameter $n$ is an input to the algorithm, the original ETC algorithm does not adapt the length of the exploration phase to the actual samples, so that understanding how to best set $n$ is not a simple task. One thing that is worth noticing is that in the 2-arm bandit case, this parameter $n$ takes values in the range $[T/2]$ . If $\tau_{\mathrm{sub}}$ in our lower bound of Theorem 1 equals $T/2$ (that is, when $T/2$ is smaller than $\log T / \Delta_{\tau}^{2}$ , $\log T / \widetilde{\Delta}_{1,\tau}^{2}$ and $\log T / \widetilde{\Delta}_{2,\tau}^{2}$ ), we cannot commit to any specific arm, and the ETC algorithm results in a solo-exploration strategy which is indeed optimal in this case (up to the choice of $i_{\mathrm{out}}$ ). Algorithm 1 describes a variant of the standard ETC policy adapted to our rested bandit scenario. At a generic round $t = Kn$ , this algorithm starts committing to an arm $i \in \mathcal{K}$ only when we are confident with probability at least $1 - \delta$ that $i$ is the arm with lowest expected loss if pulled for the remaining $T - Kn$ times (Line 4). Hence, unlike the original ETC algorithm, this algorithm implicitly computes $n$ on the fly based on the observed samples. Finally, upon committing to an arm, our algorithm does not reconsider its decision based on the newly collected samples (Line 9). We have the following result, that help elucidate the benefit of adaptively inferring $n$ . + +Theorem 3. Consider the same two-arm setting $\mathbb{P}_{\underline{\mu} (\tau)} = \mathbb{P}_{\mu_1(\tau)}\otimes \mathbb{P}_{\mu_2(\tau)}$ contained in Theorem 1 and the notation introduced therein. Running Algorithm 1 with $T\geq 1$ yields + +$$ +R _ {T} ^ {E T C} (\underline {{\mu}}) \leq \mu_ {i _ {\mathrm {o u t}}} (T - n _ {0}) - \mu_ {i _ {T} ^ {*}} (T) +$$ + +with probability at least $1 - \frac{1}{T}$ , where $n_0 = \min \left\{\frac{T}{2}, \frac{c_\rho}{\Delta_{n_0}^2}\right\}$ and $c_\rho = \frac{1600(\sqrt{U} + 1)^4}{\rho^2(1 - \rho)^2} \log (4n_0T^2)$ . + +This result is optimal up to a logarithmic factor (namely, $i_{\mathrm{out}} \in \arg \min_{i \in \mathcal{K}} \mu_i(T - n_0)$ and $n_0 = \tau_{\mathrm{sub}}$ up to a logarithmic factor) whenever $n_0 = \frac{c_\rho}{\Delta_{n_0}^2}$ and $\tau_{\mathrm{sub}} = \frac{1}{8C\Delta_\tau^2}\log \left(C\Delta_\tau^2\tau /4\right)$ . Conversely, when at least one of the + +above conditions is not met, the bound contains an additional $\tilde{O}\left(1 / \sqrt{n_0}\right)$ term if compared to the result of Theorem 1, where $\tilde{O} (\cdot)$ hides log $T$ factors. + +Notice that finding the commitment condition for ETC cannot be readily obtained by available results in the bandit literature, as this requires a specific understanding of the interplay among the loss curves. Even in the two arm case of Theorem 3, it is not possible to avoid the unfriendly implicit form of the regret bound coming from the definition of $n_0$ therein. + +Starting from ETC, in the next section we present our final learning policy, which will be analyzed both in the general $K$ -armed case and in the specific setting contained in the lower bound of Section 4. + +# 6.1. Towards an Optimal Policy + +The first limitation of the ETC strategy in Algorithm 1 becomes clear when considering more than 2 arms. Let us consider an instance with $K = 3$ arms where there exist two values $n_2, n_3$ satisfying: + +$$ +\widehat {\mu} _ {1} \left(n ^ {\prime}\right) < \widehat {\mu} _ {2} \left(n ^ {\prime}\right) - 2 C B _ {\mu , n _ {2}} \left(n _ {2}\right) \quad \forall n ^ {\prime} > n _ {2} +$$ + +$$ +\widehat {\mu} _ {1} \left(n ^ {\prime}\right) < \widehat {\mu} _ {3} \left(n ^ {\prime}\right) - 2 C B _ {\mu , n _ {3}} \left(n _ {3}\right) \quad \forall n ^ {\prime} > n _ {3}. +$$ + +The ETC policy in Algorithm 1 has a single counter $n$ that has to satisfy at the same time $K - 1 = 2$ arm elimination conditions (line 4 of Algorithm 1). The best this algorithm can do in order not to commit to the wrong arm is to keep exploring up to $n = \max \{n_2, n_3\}$ . The obvious drawback of this solution is that ETC would then waste $|n_2 - n_3|$ pulls on the sub-optimal arms 2 and 3, rather than selecting $i_{\mathrm{out}} = 1$ . We now present in Algorithm 2 the strategy REST-SURE (RESTed SUccessive REject), a rested version of the Successive Reject algorithm from (Even-Dar et al., 2006; Audibert & Bubeck, 2010). As for its stationary counterpart, REST-SURE keeps sampling all the active arms in a round-robin fashion, and then periodically removes arms once it is confident about their sub-optimality (line 12). The key adaptation to our rested bandit scenario is that one arm is deemed sub-optimal when there is a better arm in any of the still reachable states. + +Going into some details of the pseudocode, the stopping condition in lines 4 of Algorithm 2 is inspired by the same reasoning governing the commitment in the stationary bandit problem. This condition tells us that exploration has provided enough information to identify (with high probability) arm $i_{\mathrm{out}} = \arg \min_{i\in \mathcal{K}}\mu_i(\tau_{\mathrm{out}})$ at the best reachable state. The second stopping condition (line 8) is due to the non-stationary component in the expected loss (2). This condition controls the trade-off between the estimation of $i_{\mathrm{out}} = \arg \min_{i\in \mathcal{K}}\mu_i(\tau_{\mathrm{out}})$ and the minimization of the incurred expected loss, namely the impact on the value of + +Algorithm 2 REST-SURE +Require: Confidence parameter $\delta = 1 / T$ +1: Initialize: $\mathcal{A}_0 = \mathcal{K},n = 0,\tau_{\mathrm{out}} = T$ , and $t = 0$ +2: for $t = 1,\dots ,T$ do +3: $\tau_{\mathrm{out}} = T - t + n$ +4: if $\exists i\in \mathcal{A}_n:\widehat{\mu}_i(\tau_{\mathrm{out}}) < \min_{j\in \mathcal{A}_n\backslash \{i\}}\widehat{\mu}_j(\tau_{\mathrm{out}}) -$ $2CB_{\mu ,n}(\delta)$ then +5: $i_{\mathrm{out}} = \arg \min_{i\in \mathcal{A}_n}\widehat{\mu}_i(\tau_{\mathrm{out}})$ +6: break; {Found $i^{*}_{\tau_{\mathrm{out}}}$ w.h.p.} +7: end if +8: if $\min_{i\in \mathcal{A}_n}\widehat{\mu}_{i,n}(\tau_{\mathrm{out}} - |\mathcal{A}_n| + 1) - 2CB_{\mu ,n}(\delta)>$ $\min_{i\in \mathcal{A}_n}\widehat{\mu}_{i,n}(\tau_{\mathrm{out}})$ then +9: $i_{\mathrm{out}}$ randomly chosen in $\mathcal{A}_n$ +10: break; {No advantage in learning $i^{*}_{\tau_{\mathrm{out}}}$ } +11: end if +12: $\mathcal{A}_{n + 1} = \mathcal{A}_n$ +13: for each arm $i\in \mathcal{A}_{n + 1}$ such that $\forall m\in [n,\tau_{\mathrm{out}}]$ .. $\exists j\in \mathcal{A}_{n + 1}:\widehat{\mu}_{i,n}(m) - \widehat{\mu}_{j,n}(m) > 2CB_{\mu ,n}(\delta)$ do +14: $\mathcal{A}_{n + 1} = \mathcal{A}_{n + 1}\setminus \{i\}$ {Arm elimination} +15: end for +16: Pull once each active arm $i\in \mathcal{A}_{n + 1}$ +17: $t = t + |\mathcal{A}_{n + 1}|;\quad n = n + 1$ +18: end for +19: Play $i_{\mathrm{out}}$ until round $T$ {Commit} +20: Output $i_{\mathrm{out}}$ + +$\tau_{\mathrm{out}}$ . In particular, this condition stops the policy in its exploration towards the identity of $i_{\mathrm{out}}$ as soon as this would cause an increased regret due to a reduced valued of $\tau_{\mathrm{out}}$ . + +We need the following additional notation. We set for brevity $\Delta_{j,i}(\tau) = \mu_j(\tau) - \mu_i(\tau)$ for any $\tau \in [T]$ , $K_n = K - n$ , and $\mu^{*}(\tau) = \min_{i\in \mathcal{K}}\mu (\tau)$ denotes the smallest expected loss over all arms after each one of them has been pulled $\tau$ times. The following is the main result of this section. + +Theorem 4. For all $K > 1$ , if REST-SURE is run on $K$ arms having arbitrary non-stationary loss distributions $\mathbb{P}_{\underline{\mu}(m)} = \mathbb{P}_{\mu_1(m)}, \otimes, \ldots, \otimes, \mathbb{P}_{\mu_K(m)}$ with support in $[0,1]$ and expected value parameterized according to (2), then with probability at least $1 - \frac{1}{T}$ the pseudo-regret of REST-SURE after $T$ interactions satisfies + +$$ +R _ {T} ^ {\mathrm {R E S T - S U R E}} (\underline {{\mu}}) \leq \mu_ {i _ {\mathrm {o u t}}} (T - \overline {{n}}) - \mu_ {i _ {T} ^ {*}} (T), +$$ + +where $\overline{n} = \sum_{s\in [K - 1]}n_{\sigma (s)}$ , and $n_{\sigma (s)}$ is defined as the + +![](images/45818f3c9368e2faa89b45a8115a0724bb5fa5dbe2d34ba09f0fc3a859007057.jpg) +Figure 2. Expected losses associated with the arms in Example 2. + +smallest $n\in [T]$ which is greater than + +$$ +\begin{array}{l} \min \left\{\frac {T - \sum_ {j = 1} ^ {s - 1} n _ {\sigma (j)}}{K _ {s - 1}}, \right. \\ \frac {c _ {\rho} \log (n K ^ {2} T ^ {2})}{\min _ {j \in \mathcal {A} _ {s - 1} ^ {*}, m \in [ n _ {\sigma (s) , \tau_ {\mathrm {o u t}} (s)} ]} \Delta_ {\sigma (s) , j} ^ {2} (m)}, \\ \frac {c _ {\rho} \log (n K ^ {2} T ^ {2})}{\left(\mu^ {*} \left(\tau_ {\mathrm {o u t}} (s) - K _ {s + 1}\right) - \mu^ {*} \left(\tau_ {\mathrm {o u t}} (s)\right)\right) ^ {2}}, \\ \left. \frac {c _ {\rho} \log (n K ^ {2} T ^ {2})}{\left(\min _ {j \in \mathcal {K}} \left(\Delta_ {\sigma (s) , j} (\tau_ {\text {o u t}} (s))\right) ^ {2} \right.} \right\}. \\ \end{array} +$$ + +In the above, $\mathcal{A}_s^* = \mathcal{K} \setminus \{\sigma(1), \ldots, \sigma(s-1)\}$ , $\tau_{\mathrm{out}}(n) = T - \sum_{s=1}^{n} K_{s+1} n_{\sigma(s)}$ and $c_\rho = \frac{1600(\sqrt{U} + 1)^2}{\rho^2(1 - \rho)^2}$ . Notice that $\sigma(s) = \arg \min_{j \in \mathcal{A}_{s-1}^*} n_{\sigma(j)}$ . Finally, $i_{\mathrm{out}} \in \arg \min_{i \in \mathcal{K}} \mu_i(T - \overline{n})$ only if $\min_{j \in \mathcal{A}_{s-1}^*} \Delta_{\sigma(s),j}(\tau_{\mathrm{out}}(s))$ is greater than $\mu^*(\tau_{\mathrm{out}}(s) - K_{s+1}) - \mu^*(\tau_{\mathrm{out}}(s))$ . Conversely, when the latter condition is not met we can only guarantee that $\mu_{i_{\mathrm{out}}} (T - \overline{n}) \leq \mu^*(T - \overline{n}) + \tilde{O}(1 / \sqrt{n_{i_{\mathrm{out}}}})$ . + +Notice that $\overline{n}$ is solely a function of the problem parameters $\{\alpha_{i},\beta_{i}\}_{i\in \mathcal{K}},\rho ,K,U$ and $T$ . This is because so are the involved quantities $\sigma (s)$ and $n_{\sigma (s)}$ . The exact expression for $\overline{n}$ might be somewhat hard to interpret. The first term in the min plays the same role as term $T / 2$ in Theorem 1, and guarantees the total number of pulls is most $T$ . The second term is obtained from the arm-elimination condition of line 12. The third term in the min is obtained by analyzing the condition at lines 7-8. Finally, the commitment to arm $i_{\mathrm{out}}$ yields the fourth term. In order to clarify the heavy statement of Theorem 4, we now present a symbolic example. + +Example 2. For the sake of illustration, let us consider the specific instance of the above theorem with $K = 3$ arms whose expected losses are sketched in Figure 2. In that figure, $\tau_{1}$ is the number of times REST-SURE needs to pull each arm before eliminating arm 2. Hence, we have $\sigma(1) = 2$ and $n_{\sigma(1)} = \tau_{1}$ . Similarly, $\tau_{2}$ is the number of pulls associated with the remaining arms $A_{\tau_{2}} = \{1,3\}$ before committing to arm 3. Hence, with probability at least $1 - 1 / T$ , we have $\sigma(2) = 1$ , $i_{\mathrm{out}} = 3$ and $\overline{n} = \tau_{1} + \tau_{2}$ . + +The proof of Theorem 4 is an extension of the proof of Theorem 3, and is given in the appendix. To conclude, we now show that the bound of REST-SURE matches the lower bound given in Theorem 1 up to logarithmic factors. + +Corollary 1. Let us consider the same two-arm setting $\mathbb{P}_{\underline{\mu} (\tau)} = \mathbb{P}_{\mu_1(\tau)}\otimes \mathbb{P}_{\mu_2(\tau)}$ as in Theorem 1 and the notation introduced therein. Running Algorithm 2 with $T\geq 1$ yields + +$$ +R _ {T} ^ {\mathrm {R E S T - S U R E}} (\underline {{\mu}}) \leq \mu_ {i _ {\mathrm {o u t}}} (T - n _ {0}) - \mu_ {i _ {T} ^ {*}} (T) +$$ + +with probability at least $1 - \frac{1}{T}$ . In the above, $n_0 = \min \left\{\frac{c_\rho}{\Delta_{n_0}^2}, \frac{c_\rho}{\overline{\Delta}_{n_0}^2}, \frac{T}{2}\right\}$ and $c_\rho = 25600(\sqrt{U} + 1)^4 \log (4n_0 T^2)$ . This result is optimal up to a logarithmic factor (namely, $i_{\mathrm{out}} \in \arg \min_{i \in \mathcal{K}} \mu_i(T - n_0)$ and $n_0 = \tau_{\mathrm{sub}}$ up to a logarithmic factor) whenever $n_0 = \frac{c_\rho}{\Delta_{n_0}^2}$ and $\tau_{\mathrm{sub}} = \frac{1}{8C\Delta_{\tau}^2} \log \left(C\Delta_{\tau}^2\tau / 4\right)$ . Conversely, when at least one of the above conditions is not met, the bound contains an additional $\tilde{O}\left(1 / \sqrt{n_0}\right)$ term if compared to the result of Theorem 1, where $\tilde{O}(\cdot)$ hides $\log T$ factors. + +Notice that, differently from Theorem 3, the definition of $n_0$ now matches the one of $\tau_{\mathrm{sub}}$ in Theorem 1 up to a logarithmic factor. Furthermore, the extra term $\tilde{O}\left(\frac{1}{\sqrt{n_0}}\right)$ is always smaller than the one mentioned in Theorem 3. + +# 7. Conclusions and Ongoing Research + +In this work we have proposed an online algorithm selection problem formulated as a best arm identification within a specific rested bandit scenario. Here, each arm represents a candidate learning model and each pull corresponds to giving the associated learner more i.i.d training samples, thus allowing the learner to reduce its generalization error. We formulated an ad hoc notion of regret, provided a lower bound for the learning problem, and analyzed two alternative strategies, one of which we have shown to be optimal in the cases covered by the lower bound. + +We considered losses of the parametric form $f(\tau; (\alpha, \beta)) = \frac{\alpha}{\tau^{\rho}} + \beta$ due to their relevance when considering the typical behavior of generalization error as a function of training set size. Yet, our analysis can be generalized to any parametric family of non-increasing functions $f(\tau; \theta)$ , where $\theta$ is a vector of parameters. + +At last we note that, while the focus of this paper has been theoretical, future work may be devoted to study the empirical performance of our methods and the underlying bounds. In Appendix D we included simple preliminary experiments on synthetic data that help corroborate our theoretical findings. A deeper investigation on real-world data is left to the future. + +# References + +Agarwal, A., Luo, H., Neyshabur, B., and Schapire, R. Corralling a band of bandit algorithms. In Conference on Learning Theory, pp. 12-38, 2017. +Allesiardo, R., Féraud, R., and Maillard, O.-A. The nonstationary stochastic multi-armed bandit problem. International Journal of Data Science and Analytics, 3(4): 267-283, 2017. +Audibert, J.-Y. and Bubeck, S. Best Arm Identification in Multi-Armed Bandits. In $COLT - 23$ th Conference on Learning Theory - 2010, pp. 13 p., Haifa, Israel, June 2010. URL https://hal-enpc.archives-ouvertes.fr/hal-00654404. +Auer, P., Cesa-Bianchi, N., and Fischer, P. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235-256, 2002. +Besbes, O., Gur, Y., and Zeevi, A. Stochastic multi-armed-bandit problem with non-stationary rewards. In Advances in neural information processing systems, pp. 199-207, 2014. +Bubeck, S., Cesa-Bianchi, N., et al. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5 (1):1-122, 2012. +Bubeck, S., Perchet, V., and Rigollet, P. Bounded regret in stochastic multi-armed bandits. In Conference on Learning Theory, pp. 122-134, 2013. +Cella, L. and Cesa-Bianchi, N. Stochastic bandits with delay-dependent payoffs. In International Conference on Artificial Intelligence and Statistics, pp. 1168-1177, 2020. +Cesa-Bianchi, N. Multi-armed Bandit Problem. Springer New York, New York, NY, 2016. ISBN 978-1-4939-2864-4. +Cutkosky, A., Dann, C., Das, A., Gentile, C., Pacchiano, A., and Purohit, M. Dynamic balancing for model selection in bandits and r1. In ICML, 2021. +Even-Dar, E., Mannor, S., and Mansour, Y. Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. Journal of machine learning research, 7(Jun):1079-1105, 2006. +Foster, D., Gentile, C., Mohri, M., and Zimmert, J. Adapting to misspecification in linear contextual bandits and beyond. In Advances in Neural Information Processing Systems, 2020. + +Foster, D. J., Krishnamurthy, A., and Luo, H. Model selection for contextual bandits. In Advances in Neural Information Processing Systems, pp. 14714-14725, 2019. +Gabillon, V., Ghavamzadeh, M., and Lazaric, A. Best arm identification: A unified approach to fixed budget and fixed confidence. In Advances in Neural Information Processing Systems, pp. 3212-3220, 2012. +Jamieson, K. and Talwalkar, A. Non-stochastic best arm identification and hyperparameter optimization. In Artificial Intelligence and Statistics, pp. 240-248, 2016. +Kaufmann, E., Cappé, O., and Garivier, A. On the complexity of best-arm identification in multi-armed bandit models. The Journal of Machine Learning Research, 17 (1):1-42, 2016. +Kleinberg, R. and Immorlica, N. Recharging bandits. In 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS), pp. 309-319. IEEE, 2018. +Kolobov, A., Bubeck, S., and Zimmert, J. Online learning for active cache synchronization. arXiv preprint arXiv:2002.12014, 2020. +Lai, T. L. and Robbins, H. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1): 4-22, 1985. +Lattimore, T. and Szepesváři, C. Bandit algorithms. Cambridge University Press, 2020. +Levine, N., Crammer, K., and Mannor, S. Rotting bandits. In Advances in neural information processing systems, pp. 3074-3083, 2017. +Li, L., Jamieson, K., DeSalvo, G., Rostamizadeh, A., and Talwalkar, A. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research, 18(1):6765-6816, 2017. +Mintz, Y., Aswani, A., Kaminsky, P., Flowers, E., and Fukuoka, Y. Non-stationary bandits with habituation and recovery dynamics. arXiv preprint arXiv:1707.08423, 2017. +Ortner, R., Ryabko, D., Auer, P., and Munos, R. Regret bounds for restless markov bandits. Theoretical Computer Science, 558:62-76, Nov 2014. ISSN 0304-3975. doi: 10. 1016/j.tcs.2014.09.026. URL http://dx.doi.org/ 10.1016/j.tcs.2014.09.026. +Pacchiano, A., Phan, M., Abbasi-Yadkori, Y., Rao, A., Zimmert, J., Lattimore, T., and Szepesvari, C. Model selection in contextual stochastic bandit problems. arXiv preprint arXiv:2003.01704, 2020. + +Pike-Burke, C. and Grunewalder, S. Recovering bandits. In Advances in Neural Information Processing Systems, pp. 14122-14131, 2019. +Russac, Y., Vernade, C., and Cappé, O. Weighted linear bandits for non-stationary environments. In Advances in Neural Information Processing Systems, pp. 12017-12026, 2019. +Seznec, J., Locatelli, A., Carpentier, A., Lazaric, A., and Valko, M. Rotting bandits are no harder than stochastic ones. arXiv preprint arXiv:1811.11043, 2018. +Siegmund, D. Herbert Robbins and sequential analysis. Annals of statistics, pp. 349-365, 2003. +Soare, M., Lazaric, A., and Munos, R. Best-arm identification in linear bandits. In Advances in Neural Information Processing Systems, pp. 828-836, 2014. +Tekin, C. and Liu, M. Online learning of rested and restless bandits. IEEE Transactions on Information Theory, 58 (8):5588-5611, 2012. +Tsybakov, A. B. Introduction to nonparametric estimation. Springer Science & Business Media, 2008. +Whittle, P. Restless bandits: Activity allocation in a changing world. booktitle of applied probability, 25(A):287-298, 1988. \ No newline at end of file diff --git a/bestmodelidentificationarestedbanditformulation/images.zip b/bestmodelidentificationarestedbanditformulation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..10edd0afc06194b86eace337828cd11f1f34fe74 --- /dev/null +++ b/bestmodelidentificationarestedbanditformulation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:677acb5e64683efdb33094794254ed8cdf80365d90f779261ca0ebd71b00a264 +size 187652 diff --git a/bestmodelidentificationarestedbanditformulation/layout.json b/bestmodelidentificationarestedbanditformulation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ca90afe980f9d039a3d0f3be80ddffd471cc75ee --- /dev/null +++ b/bestmodelidentificationarestedbanditformulation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf3499e7ee7a78d65cf6f19c08033ecf170aa1d4214e8ce308632e21c292f64a +size 693571 diff --git a/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_content_list.json b/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f3dce6ce8cec5abcc1acb6ddf3acc4748e1914f --- /dev/null +++ b/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45b7727309c5f402aa3dd50b9a3a8161733a69961aab0a1c998f58c4c09bf9fd +size 89988 diff --git a/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_model.json b/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c71702eeb018932a7b2dff4825dbf46ee91ce5d8 --- /dev/null +++ b/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f5d42720dcb81cb6341f8a1fceb63b5c76ae27358047cbc9c25d1d223ad5c73 +size 110826 diff --git a/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_origin.pdf b/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e6d01b98cf90168f98730b4345da0a66ad794f9e --- /dev/null +++ b/bettertrainingusingweightconstrainedstochasticdynamics/12bf96f6-3238-49bc-8587-d961d745f596_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9a34971f2e82995deeaa4dde9685561e623f90107588fd1b7dd580ebdb2c770 +size 7111787 diff --git a/bettertrainingusingweightconstrainedstochasticdynamics/full.md b/bettertrainingusingweightconstrainedstochasticdynamics/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f6dbd251b0230978966f8ecf8fb09218d815252e --- /dev/null +++ b/bettertrainingusingweightconstrainedstochasticdynamics/full.md @@ -0,0 +1,413 @@ +# Better Training using Weight-Constrained Stochastic Dynamics + +Benedict Leimkuhler 1 Tiffany Vlaar 1 Timothée Pouchon 1 Amos Storkey 2 + +# Abstract + +We employ constraints to control the parameter space of deep neural networks throughout training. The use of customized, appropriately designed constraints can reduce the vanishing/exploding gradients problem, improve smoothness of classification boundaries, control weight magnitudes and stabilize deep neural networks, and thus enhance the robustness of training algorithms and the generalization capabilities of neural networks. We provide a general approach to efficiently incorporate constraints into a stochastic gradient Langevin framework, allowing enhanced exploration of the loss landscape. We also present specific examples of constrained training methods motivated by orthogonality preservation for weight matrices and explicit weight normalizations. Discretization schemes are provided both for the overdamped formulation of Langevin dynamics and the underdamped form, in which momenta further improve sampling efficiency. These optimization schemes can be used directly, without needing to adapt neural network architecture design choices or to modify the objective with regularization terms, and see performance improvements in classification tasks. + +# 1. Introduction + +We study stochastic training methods based on Langevin dynamics combined with algebraic constraints. Our general framework allows for incorporating constraints into standard training schemes and sampling methods for neural networks. Constraints provide direct control of the parameter space of a model and hence afford a means to improve its generalization performance. As applications, we consider magnitude control and orthogonality of neural network weights. + +$^{1}$ Department of Mathematics, University of Edinburgh, United Kingdom $^{2}$ Department of Informatics, University of Edinburgh, United Kingdom. Correspondence to: Tiffany Vlaar . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +Current approaches to enhance the generalization performance of overparameterized neural networks consist of both explicit and implicit regularization techniques (Neyshabur et al., 2015). Examples of the former are L1 (Williams, 1995; Tibshirani, 1996) and L2 (Hoerl & Kennard, 1970) regularization, which modify the loss by adding a parameter norm penalty term. Batch normalization (BatchNorm) (Ioffe & Szegedy, 2015) is a technique that causes an implicit regularization effect. BatchNorm can be viewed as tantamount to a constraint imposed on the network's parameters during training. Although BatchNorm is widely used, explanations for the method's success remain elusive (Santurkar et al., 2018; Yao et al., 2019). The reliance on increasingly complex strategies does little to enhance the explainability of neural networks, so robust simplification of all aspects of training is desirable. The constrained approach proposed in this paper provides a conceptually straightforward and interpretable framework that offers direct control of parameter spaces, without requiring modifications to the neural network architecture or objective. The transparency of this approach allows for drawing a direct connection between the use of weight constraints and the generalisation performance of the resulting neural network. + +In neural network (NN) training one aims to minimize the loss $L_{X}(\theta)$ for parameters $\theta \in \mathbb{R}^n$ and data $X$ . Constraints can be seen as limiting cases of penalty-based regularization which replaces minimization of the loss $L_{X}(\theta)$ by that of the augmented loss $L_{X}^{c}(\theta) = L_{X}(\theta) + \frac{1}{\varepsilon^{2}} g(\theta)^{2}$ , where $g(\cdot)$ is a suitable smooth function of the parameters. In the limit $\varepsilon \to 0$ , these penalty terms introduce an undesirable stiffness and consequent stability restriction in gradient-based training, which limits the choice of step size (see Figure 5 for an illustration). It is therefore natural to relate the above system to a constrained optimization task subject to $g(\theta) = 0$ (see Section 3). + +A popular NN training scheme is stochastic gradient descent (SGD). SGD may be improved by incorporating momenta (Sutskever et al., 2013) and additive noise (Welling & Teh, 2011; Wenzel et al., 2020), or more generally by embedding the loss gradient in a Langevin dynamics (LD) framework (Cheng et al., 2017). We will combine the resulting discretized stochastic differential equation (SDE) approach with constraints (Sec. 4). The benefit of using constrained SDEs for NN training is illustrated in Figure 1, where the + +![](images/20139cd9ae082ad378323deff884d3efb00f77d63258458086e220d661dbd58d.jpg) + +![](images/657f261f0d19c2f0e955d96536dacd61f64861fa96d70e9e41ca82cfee86d9f0.jpg) + +![](images/95be81c3b35bb85317e3a1a5d5b743e8266175f93aec42a1ab27875e73e2594c.jpg) + +![](images/27bdaa6d6ca234ba64b66e84407571e44a2f9710ce8da4d3a5fe51decc56a83a.jpg) + +![](images/0f3c82fca69f4273bb6ccbff15991c66fa771bd51c43fcbb1eceeb31585effe4.jpg) + +![](images/1d96c4546e4c81d88aedb3004b6cfd4c4204ae6045bc48701dcf5e31fd749bcb.jpg) + +![](images/ae79537308b1514ddaf34a7a66538ec30356399cd2b5c0751391c7dfd06e5133.jpg) + +![](images/9682358b48ab0fb966d9301aa1b62dcaf111b5f27081b10ae9d505127629a472.jpg) + +![](images/cd3f871f3f5432ff9149098dfda3e00f4f48bd88335e64b549a5229ebda53371.jpg) + +![](images/747b1e79b32df116048b932e3a5b908bfa814e3bae7b772fa10965bd42a40efc.jpg) + +![](images/c00ca8f5423fd18e76541bb1f07f3d95fecb1419c4418e4e702ef613d1f99d7a.jpg) +Figure 1. Classifiers obtained using different optimizers: SGD (1st column), SGD with weight decay (WD) (2nd col.), constrained SGD (C-SGD) (3rd col.), SGLD (Welling & Teh, 2011) (4th col.), constrained SGLD (5th col.) using a 500-node single hidden layer perceptron for a spiral binary classification problem. Top and middle row show training and test data points, respectively, and decision boundaries of the trained classifier. Bottom row shows loss curves. Hyperpar. settings: all: $h = 0.05$ , $2\%$ subsampling; SGD with WD = 1e-4; C-SGD: $r_0 = 1$ , $r_1 = 5$ (see Eq. (2)); SGLD and C-SGLD: $\tau = 5\mathrm{e} - 5$ (see Eq. (7)). We observe that although the use of WD can stabilize the test loss, it does not improve test accuracy (2nd col.). In contrast, our constrained approach (3rd col.) maintains a stable test loss throughout training and improved generalization performance. The use of additive noise (or low temperature) in combination with the constraints (C-SGLD, 5th col.) strongly outperforms standard SGD: $91.7\%$ vs. $81\%$ test acc., resp., and obtains smoothened classification boundaries. + +![](images/53a20b2fac41b83b29ca0d6d5924d7a56e67731b79710bc91b4b166f998efbff.jpg) + +![](images/e72fb9cbb21a87dd2416a9c329e0c0ff35cdb3acb4fcb1895fa8c0211da0a977.jpg) + +![](images/ed093e3bb9170a37f5b2caadf08dd3da9a2e51e553c4e47935d7cf6cc4b5f091.jpg) + +![](images/16a080bca3b7465c7d089abe466c09bdd9d7b45fa636eca18b68906262fd06b4.jpg) + +combination of using additive noise and magnitude constraints (as defined by Eq. (2)) leads to smoother classification boundaries and significantly enhanced generalization performance (compare the 5th column, the constrained SDE approach, with column 1, standard SGD). These observations are maintained over 100 runs (see Fig. 2, Fig. 3, and Table 1). We distinguish between two different types of smoothness of the resulting classifiers: first, the curvature of the classification boundary and second, the sharpness of the transition between prediction regions belonging to different classes. As shown in Table 1 and Fig. 3 the use of magnitude constraints throughout training generates classifiers which exhibit both types of smoothness. The use of additive noise throughout training further reduces the curvature of the classification boundary. In contrast, the use of weight decay is not sufficient for SGD to obtain the same levels of smoothness. See Appendix D for further numerical details. + +Table 1. Accompanies Fig. 1 and 2, with same hyperparameter settings. We present estimates of the mean, standard deviation (std), and maximum (max) curvature of classifier boundaries obtained using different optimizers evaluated over 100 runs after training for a fixed number of 10,000 epochs. We computed our curvature estimates using the method described in Appx. D, which we suggest is indicative of the curvature of the locally smoothed classification boundary and allows us to compare the relative curvature estimates of classifiers trained using different optimizers. The combined use of constraints and additive noise (C-SGLD) obtains much lower curvatures compared to SGD with weight decay (WD). + +
OptimizerCurvature Approximation
MeanStdMax
SGD5194.33 ·1043.26·108
SGD with WD51.13.80 ·1031.14 ·107
C-SGD9.383175.58 ·105
SGLD8.731896.27 ·105
C-SGLD6.0840.81.43 ·105
+ +![](images/b7013810f68daad411498c79e4b9d840686cc5773293bfd453e859d261919718.jpg) +Figure 2. Same data and hyperparameter settings as for Fig. 1, but these results are averaged over 100 runs. Constrained approaches, C-SGD and C-SGLD (with additive noise), clearly outperform standard SGD and SGD with WD in terms of test loss and test accuracy. + +![](images/b867d411511a3cf2eb30c4ccc2f972d620fadffda9c97fd3d74fbee53048aa93.jpg) + +![](images/4787491b462fb0a5332bcf5adba5fb7ece846ad0003c9230d5c080b4b1a3fb81.jpg) +Figure 3. Same data and hyperparameter settings as in Fig. 1 and 2. We show gradients of the prediction along horizontal $(y = 0)$ and vertical cross-sections $(x = 0)$ . The results are averaged over 100 runs and evaluated at 10,000 epochs. Our constrained approach C-SGLD exhibits less sharp transitions between classes than SGD (middle/right plot). The size of the constraint directly controls this property (this is illustrated in the left plot for the input layer with constraint size $r_0$ in Eq. (2) for all input layer weights). + +![](images/05cdf99b181bcf4e79e5d63733949ddb409f2ca0c81c9bea367817e89344b30b.jpg) + +![](images/a7e5c4bebc2c3c2f892931dda2d43a7fcbb6030172cbebbde575c62c3b1d5c23.jpg) + +Apart from such magnitude constraints, the general framework provided in this paper allows for straightforward incorporation of other constraints. Another specific example we consider is orthogonality of the weight matrix. We provide detailed algorithms for both of these purposes and for a general constraint in a Langevin dynamics setting (Sec. 4 and Appendix B) and show improved generalization performance on classification tasks (Sec. 5). + +Concretely, our contributions are: + +- We introduce the use of constrained stochastic differential equations for neural network training. +- We provide a general mathematical framework that allows for implementation of new constraints. +- We propose specific constraints, magnitude control and orthogonality of neural network weights, and provide algorithms to accompany these. The benefit of using these is illustrated for several networks and datasets and is shown to outperform soft constraints (such as weight decay or orthogonal regularization). + +- We provide PyTorch code to support our algorithms, which can be found on https://github.com/TiffanyVlaar/ConstrainedNNtraining + +# 2. Background and Related Work + +Neural network loss landscapes are notoriously difficult to characterize rigorously due to their high-dimensionality and non-convexity. Although they appear to contain multiple, roughly equivalent local minima which exhibit nearly zero training loss (Choromanska et al., 2015; Kawaguchi, 2016; Keskar et al., 2017), not all these minima obtain the same generalization performance (Chaudhari et al., 2017; Wu et al., 2017). The training of deep neural networks is hypersensitive to e.g., the choice of initialization (Sutskever et al., 2013), optimizer (Wilson et al., 2017), and hyperparameter settings (Jastrzewski et al., 2018), including learning rate scheduling (Loshchilov & Hutter, 2017; Smith, 2017). Without careful hyperparameter tuning, the loss landscape may not be explored sufficiently by the optimization scheme, thus resulting in a reduced generalization performance of the trained network (Zhang et al., 2015; Keskar et al., 2017). + +Sampling methods, which use small amounts of additive noise (Leimkuhler et al., 2019; Wenzel et al., 2020), have been found to enhance exploration and speed the approach to 'good' minima, which enhance their generalization to nearby data sets. Hence, we incorporate the flexibility to use additive noise to enhance exploration in our optimization schemes by taking a constrained SDE approach to neural network training. We propose a general mathematical framework for this purpose and consider the ergodic properties of the idealized SDEs associated with gradient schemes, which may help these methods to ensure robust exploration of a useful range of parameters (Sec. 4). We further propose specific constraints (Sec. 3) and show that the use of these leads to enhanced performance compared to soft constraints, such as weight decay or orthogonal regularization (Sec. 5). + +Magnitude control of neural network weights. In this work we consider a circle constraint, which limits the magnitude of the size of the weights (we typically leave the biases unconstrained). A corresponding soft constraint, which adds a penalty term to the loss, is weight decay or L2 regularization (Hoerl & Kennard, 1970). We also propose a sphere constraint, which is analogous to max-norm (Srebro & Shraibman, 2005; Srivastava et al., 2014) as used in some regularization procedures. However, applying this constraint in combination with additive noise does yield a distinctive training method. + +Orthogonality of the weight matrix. The concept of orthogonality has surfaced several times in the recent neural network literature. Orthogonal matrices have properties (norm preservation, unit singular values) which are thought to provide enhanced numerical stability (Zhou et al., 2006; Rodríguez et al., 2017). An orthogonal matrix $Q \in \mathbb{R}^{r \times s}$ (i.e., $Q^T Q = I_s$ ) is an isometry: $\| Qz \| = \| z \| \forall z \in \mathbb{R}^s$ . Orthogonal weight matrices were shown to mitigate the vanishing/exploding gradient problem in RNNs (Pascanu et al., 2013; Arjovsky et al., 2016; Vorontsov et al., 2017) and are developing a growing following in the CNN literature as well (Rodriguez et al., 2017; Bansal et al., 2018; Huang et al., 2018; Li et al., 2019). Orthogonal initialization is linked to achieving dynamical isometry (Saxe et al., 2013; Pennington et al., 2017; 2018), which can accelerate training. Xiao et al. (2018) were able to train 10,000 layer vanilla CNNs, without learning rate decay, BatchNorm or residual connections, by using initial orthogonal convolution kernels. + +Methods for enforcing orthogonality during training include the use of 'soft' constraints which add a restraint term to the loss (Brock et al., 2017; Xie et al., 2017; Bansal et al., 2018) and hard constraints based on optimization over Stiefel manifolds (Huang et al., 2018; Jia et al., 2019). The latter requires repeated singular value decomposition of high-dimensional matrices during training, which is costly. Int his work we propose a straightforward algorithm to incorporate orthonor + +mality constraints for rectangular matrices within our NN training framework, with manageable additional cost. We make no empirical claims over other manifold optimization methods, but rather provide a framework for network optimization that is theoretically sound, flexible enough to incorporate new constraints, and demonstrates good properties relative to standard SGD training or simple soft constraint approaches. + +Constrained SDEs. In this work we focus on optimization schemes for neural networks using constrained Langevin dynamics in both its overdamped and underdamped (with momentum) form. A discussion of the properties of unconstrained Langevin dynamics in its overdamped and underdamped forms was studied in Pavliotis (2014). We consider the specific issues associated to the extension of the standard framework to constrained SDEs. The ergodic properties of constrained Langevin (in the absence of gradient noise) were previously studied in Lelièvre et al. (2010) (overdamped) and Lelièvre et al. (2012) (underdamped). Exponential convergence to equilibrium for constrained overdamped Langevin is a consequence of a Poincaré inequality. Poincaré inequalities on manifolds and their use in the analysis of diffusion processes are presented in Bakry et al. (2013), Chapter 4. Finally, Langevin dynamics discretizations are studied in Faou & Lelièvre (2009); Lelièvre et al. (2010) ( overdamped) and Lelièvre et al. (2012); Leimkuhler & Matthews (2016) (underdamped). + +An alternative to the use of constrained SDEs are constrained Hamiltonian Monte Carlo (HMC) methods (Graham & Storkey, 2017; Zappa et al., 2018; Lelièvre et al., 2020). Although HMC schemes have nil sampling bias if fully converged, their acceptance rates depend on stepsize and system size (Beskos et al., 2013; Bou-Rabee & Sanz-Serna, 2018). In practice SDE-based methods are often preferred in many high-dimensional sampling calculations compared to HMC schemes as they are found to offer greater overall efficiency for a fixed computational budget. + +# 3. Neural Networks with Constraints + +Imposing good priors on neural networks is known to improve performance, e.g. convolutional neural networks (CNNs) suit image datasets better than overparameterized fully connected NNs, despite being a subset of the latter (d'Ascoli et al., 2019). Using constraints also arises naturally in the control of vanishing/exploding gradients. In Appendix C we illustrate this and also provide a connection between the magnitude of the weights and the smoothness of the interpolant. These observations suggest the use of constraints to control the magnitudes of individual weights and/or to limit the growth of gradients in deep networks. We present various approaches in this section. + +We consider a $L$ -layer neural network, which has parameters $\theta \in \mathbb{R}^n$ , with a weight matrix $W^\ell \in \mathbb{R}^{d^\ell \times d^{\ell -1}}$ and bias vector $b^\ell \in \mathbb{R}^{d^\ell}$ for each layer $\ell$ . To allow for inequality constraints, we define slack variables vector $\xi \in \mathbb{R}^{n^\xi}$ and consider variable $q = (\theta ,\xi)\in \mathbb{R}^d$ , where $d = n + n^{\xi}$ . The constraint manifold is + +$$ +\Sigma = \left\{q \in \mathbb {R} ^ {d} \mid g (q) = 0 \right\}, \quad g: \mathbb {R} ^ {d} \rightarrow \mathbb {R} ^ {m}. \tag {1} +$$ + +We partition $\theta = (\theta^u,\theta^c)$ into unconstrained $\theta^u\in \mathbb{R}^{n^u}$ and constrained $\theta^c\in \mathbb{R}^{n^c}$ parameters. We typically only constrain the neural network weights, not the biases. + +Circle constraints: In a circle constraint, we restrict each parameter in $\theta^c$ as $|\theta_i^c |\leq r_i$ , where $r_i > 0$ is given. We thus introduce $m = n^{c} = n^{\xi}$ slack variables $\xi_{i}$ and define + +$$ +g _ {i} (q) = \left| \theta_ {i} ^ {c} \right| ^ {2} + \left| \xi_ {i} \right| ^ {2} - r _ {i} ^ {2} \quad 1 \leq i \leq m. \tag {2} +$$ + +If $q \in \Sigma$ , then the parameters in $\theta^c$ are bounded as desired. + +Sphere constraints: In a similar way, we could opt to restrict the sums of squares of weights associated to the input channels of any node. For layer $\ell$ , we denote the $i$ -th row of the weight matrix $W^{\ell}$ as $\theta^{c,i}$ , set $\theta^u = b^\ell$ , introduce $m = d^\ell$ slack variables $\xi_{i}$ , and define as sphere constraint: + +$$ +g _ {i} (q) = \left\| \theta^ {c, i} \right\| ^ {2} + \left| \xi_ {i} \right| ^ {2} - r _ {i} ^ {2}, 1 \leq i \leq m, \tag {3} +$$ + +where $\|\cdot\|$ denotes the Euclidean norm. Sphere constraints are analogous to max-norm (Srebro & Shraibman, 2005; Srivastava et al., 2014), but have been unexplored in combination with additive noise. We leave this for future work. + +Orthogonality constraints: We set $\theta^u = b^\ell$ , and define as orthogonality constraint for layer $\ell$ with $n^\ell$ parameters + +$$ +g (q) = \left\{ \begin{array}{l l} {\left(W ^ {\ell}\right) ^ {T} W ^ {\ell} - I _ {n ^ {\ell - 1}}} & {\text {i f} n ^ {\ell - 1} \leq n ^ {\ell},} \\ {W ^ {\ell} \left(W ^ {\ell}\right) ^ {T} - I _ {n ^ {\ell}}} & {\text {o t h e r w i s e}.} \end{array} \right. \tag {4} +$$ + +As the matrix equality $g(q) = 0$ is symmetric, it corresponds to $m = s(s + 1) / 2$ constraints, where $s = \min \{n^{l - 1}, n^l\}$ . + +# 4. Constrained SDEs and their Discretization + +In this chapter we describe SDE-based methods for constrained neural network training. We first introduce standard (unconstrained) Langevin dynamics in Section 4.1. Then in Section 4.2 we discuss properties of constrained Langevin dynamics (LD), such as ergodicity and exponential convergence to equilibrium, which ensures the effectiveness of our schemes as training methods. In Section 4.3 we discuss the discretization of constrained Langevin dynamics in both the overdamped and the underdamped case, where the use of momenta allows us to accelerate the training process. The choice of discretization scheme will strongly affect the efficiency and robustness of the resulting training method. + +Hence, to allow for ease and efficacy of implementation of our methods, we describe the most appropriate discretization schemes in detail in Appendix B for both the general setting and for the specific constraints we consider in this paper, i.e., circle and orthogonality constraints. + +# 4.1. Langevin Dynamics + +Consider the unconstrained Langevin system of SDEs + +$$ +\mathrm {d} \theta_ {t} = p _ {t} \mathrm {d} t, \tag {5} +$$ + +$$ +\mathrm {d} p _ {t} = \left(- \nabla L \left(\theta_ {t}\right) - \gamma p _ {t}\right) \mathrm {d} t + \sqrt {2 \gamma \tau} \mathrm {d} \mathcal {W} _ {t}, +$$ + +with momenta $p$ , parameters $\theta$ , loss $L(\theta)$ , temperature hyperparameter $\tau \geq 0$ , friction hyperpar. $\gamma$ , and $d$ -dim. Wiener process $\mathcal{W}$ (Leimkuhler & Matthews, 2015). Under some mild assumptions, Langevin dynamics is provably ergodic, which means that its solutions sample the distribution: + +$$ +\rho \propto \exp [ - (L (\theta) + \| p \| ^ {2} / 2) / \tau ]. \tag {6} +$$ + +The temperature hyperparameter $\tau$ , which controls the additive noise level, provides a direct connection between a pure optimization and sampling approach. The standard Bayes posterior is recovered for $\tau = 1$ , whereas setting $\tau = 0$ will provide maximum a posteriori (MAP) point estimates. The range of values in between corresponds to an artificially sharpened posterior, where as $\tau \rightarrow 0$ , the posterior probability mass is confined closer and closer to the modes of the distribution. Using low temperatures (Leimkuhler et al., 2019; Wenzel et al., 2020), sampling methods have been found to enhance exploration and speed the approach to 'good' minima, which enhance their generalization to nearby data sets. In this work we therefore consider a constrained SDE approach to neural network training to allow for the incorporation of both constraints and additive noise. + +# 4.2. Constrained Langevin: Ergodicity and Central Limit Theorem. + +The neural network loss function naturally extends to the variable $q = (\theta, \xi) \in \mathbb{R}^d$ taking the form $V(q) = L(\theta)$ (note that in particular $\nabla_{\xi} V = 0$ ). The first continuous training method we consider is the constrained overdamped Langevin $^2$ system + +$$ +\mathrm {d} q _ {t} = - \nabla V (q _ {t}) \mathrm {d} t + \sqrt {2 \tau} \mathrm {d} \mathcal {W} _ {t} - \nabla_ {q} g (q _ {t}) \mathrm {d} \lambda_ {t}, \tag {7} +$$ + +$$ +0 = g (q _ {t}), +$$ + +where $\mathcal{W}$ is a $d$ -dim. Wiener process, $\tau \geq 0$ is the temperature hyperparameter, and $\lambda_{t}$ is an $\mathbb{R}^m$ -valued vector of Lagrange multipliers. Provided the initial configuration $q_{0}$ satisfies the constraint, any trajectory $q_{t}$ of (7) remains on the constraint manifold $\Sigma$ defined in Eq. (1). For $\beta^{-1} = \tau > 0$ , (7) is equivalent to an underlying ergodic (unconstrained) SDE (see Appx. A.1) with unique invariant measure + +$$ +\mathrm {d} \nu_ {\Sigma} = Z ^ {- 1} e ^ {- \beta V (q)} \mathrm {d} \sigma_ {\Sigma}, Z = \int_ {\Sigma} e ^ {- \beta V (q)} \mathrm {d} \sigma_ {\Sigma}, \tag {8} +$$ + +where $\sigma_{\Sigma}$ is the surface measure on $\Sigma$ + +Ergodicity ensures that averages of observables with respect to $\nu_{\Sigma}$ can be approximated by time averages of trajectories of (7). To ensure the practical use of (7) as a training method, we need the convergence to occur in a reasonable time. Thanks to the reversibility of the underlying SDE (see Appx. A.1), exponential convergence to equilibrium occurs as a consequence of a Poincaré inequality for $\nu_{\Sigma}$ (see Appx. A.2, A.3 and Bakry et al. (2013)). We provide a summary of the results here and refer to Appx. A for more details. + +A Poincaré inequality holds under a curvature-dimension assumption: there exists $\rho > 0$ such that + +$$ +C D (\rho , \infty): \quad \operatorname {R i c} _ {\mathfrak {g}} + \beta \nabla_ {\mathfrak {g}} ^ {2} V \geq \rho \mathfrak {g}, \tag {9} +$$ + +in the sense of symmetric matrices. The terms in (9) rely on the structure of $\Sigma$ as a Riemannian manifold: $\mathfrak{g}$ is the Riemannian metric, $\mathrm{Ric}_{\mathfrak{g}}$ is the Ricci curvature tensor and $\nabla_{\mathfrak{g}}^{2}V$ is the Hessian of $V$ on the manifold. Under (9) we have the following result ((Bakry et al., 2013), Appx. A.2). + +Theorem 4.1 Assume that there exists $\rho >0$ and $N > n$ such that $CD(\rho ,N)$ holds. Then $\nu_{\Sigma}$ satisfies a Poincaré inequality: there exists a constant $L > 0$ such that + +$$ +\int_ {\Sigma} \left| \phi (q) - \langle \phi \rangle_ {\nu_ {\Sigma}} \right| ^ {2} d \nu_ {\Sigma} (q) \leq \frac {1}{2 L} \int_ {\Sigma} \left| \Pi (q) \nabla \phi (q) \right| ^ {2} d \nu_ {\Sigma} +$$ + +$$ +\forall \phi \in H ^ {1} (\nu_ {\Sigma}), \tag {10} +$$ + +where $\Pi (q)$ is the projection onto the cotangent space $T_q^*\Sigma$ Eq. (A-8) and $H^{1}(\nu_{\Sigma})$ is the space of functions with square $\nu_{\Sigma}$ -integrable gradients Eq. (A-7). + +Consequences of Theorem 4.1 are the exponential convergence and a central limit theorem (CLT) for the convergence in Eq. (A-2) (see Appx. A.3). + +Corollary 4.2 If (9) holds then + +$$ +\int_ {\Sigma} \left| \mathbb {E} \left(\phi \left(q _ {t}\right) \mid q _ {0}\right) - \langle \phi \rangle_ {\nu_ {\Sigma}} \right| ^ {2} d \nu_ {\Sigma} (q _ {0}) \leq C (\phi) e ^ {- 2 L / \beta t} +$$ + +$$ +\forall \phi \in H ^ {1} \left(\nu_ {\Sigma}\right), \tag {11} +$$ + +where $C(\phi)$ depends only on $\phi$ . Furthermore we have the following convergence in law: + +$$ +\sqrt {T} \left(\langle \phi \rangle_ {T} - \langle \phi \rangle_ {\nu_ {\Sigma}}\right)\rightarrow \mathcal {N} (0, \sigma_ {\phi} ^ {2}) \quad a s T \rightarrow \infty , +$$ + +where the asymptotic variance $\sigma_{\phi}^{2}$ is bounded as + +$$ +\sigma_ {\phi} ^ {2} \leq \frac {\beta}{L} \int_ {\Sigma} \left| \phi - \langle \phi \rangle_ {\nu_ {\Sigma}} \right| ^ {2} d \nu_ {\Sigma}. +$$ + +In $\mathbb{R}^n$ assumption (9) is equivalent to convexity of $V$ , which is known to be too strong a requirement (a confining assumption is sufficient, see e.g. Lelièvre & Stoltz (2016)). Although (9) can certainly be weakened, the above results ensure that provided the curvature of the manifold is well behaved, sampling on $\Sigma$ has similar properties as on a flat space. + +Introducing momenta $p$ leads to constrained underdamped Langevin dynamics, the 2nd order counterpart of Eq. (7) + +$$ +\mathrm {d} q _ {t} = p _ {t} \mathrm {d} t, 0 = g (q _ {t}), \tag {12} +$$ + +$$ +\mathrm {d} p _ {t} = \left(- \nabla V \left(q _ {t}\right) - \gamma p _ {t}\right) \mathrm {d} t + \sqrt {2 \gamma \tau} \mathrm {d} \mathcal {W} _ {t} - \nabla g \left(q _ {t}\right) \mathrm {d} \lambda_ {t}, +$$ + +where $\gamma$ is the friction hyperparameter. The constraint induces a cotangency condition: $p\in T_q^*\Sigma$ , where $T_{q}^{*}\Sigma = \{p\in \mathbb{R}^{d}\mid \nabla^{T}g(q)p = 0\}$ is the cotangent space of the manifold $\boldsymbol{\Sigma}$ . The corresponding phase space is the cotangent bundle $T^{*}\Sigma = \{(q,p)\mid q\in \Sigma ,p\in T_{q}^{*}\Sigma \}$ . Given an initial pair $(q,p)\in T^{*}\Sigma$ , any trajectory $(q_{t},p_{t})$ of (12) stays on $T^{*}\Sigma$ for all time. + +(12) is equivalent to an underlying ergodic SDE, whose invariant measure is $\mathrm{d}\mu = e^{-\beta H(q,p)}\mathrm{d}\sigma_{T^{*}\Sigma}$ , with Hamiltonian $H(q,p) = V(q) + \frac{1}{2} p^T p$ and Liouville measure of the cotangent bundle $\sigma_{T^{*}\Sigma}$ (Lelièvre et al., 2012). Based on the result for the unconstrained case, we expect exponential convergence to equilibrium also to hold here, but will leave this technical proof (e.g. based on hypocoercivity (Villani, 2009; Lelièvre & Stoltz, 2016)) for future work. + +# 4.3. Discretization of Constrained Langevin Dynamics. + +The simplest iteration scheme $q_{n} \in \Sigma \mapsto q_{n+1} \in \Sigma$ for constrained overdamped Langevin dynamics (7) consists of an Euler-Maruyama step followed by projection onto the constraint manifold $\Sigma$ . The best choice for the projection is constraint-specific. + +For circle constraints we suggest orthogonal projection, which is both explicit and robust (we describe this in detail in Appx. B.3). For orthogonality constraints, we derive an efficient quasi-Newton scheme to solve the non-linear system for the projection step (Appx. B.5). We present the resulting training scheme in Algorithm 1, where we denote $Q = W^{\ell}$ if $n^{\ell} \leq n^{\ell - 1}$ and $Q = (W^{\ell})^{T}$ otherwise, and present one training iteration $Q_{n} \in \Sigma \mapsto Q_{n + 1} \in \Sigma$ . Further, we denote $h$ as the stepsize, $G(Q) = \nabla_{Q} V(Q)$ and $\tilde{G}$ the gradient of the loss evaluated on a randomly subsampled partial data set. $R_{n}$ is an independent standard random normal matrix of the same size as $Q$ . The initialization must be done with care: the constrained parameters and the potential slack variable must satisfy the constraint initially. + +# Algorithm 1 Orthog. constraint overdamped Langevin + +# Every step: + +$$ +\begin{array}{l} Q ^ {(0)} = Q _ {n} - h \tilde {G} (Q _ {n}) + \sqrt {2 \tau h} R _ {n}, \\ \mathbf {f o r} k = 0 \mathbf {t o} K - 1 \mathbf {d o} \\ Q ^ {(k + 1)} = Q ^ {(k)} - \frac {1}{2} Q _ {n} \left(\left(Q ^ {(k)}\right) ^ {T} Q ^ {(k)} - I _ {s}\right), \\ e n d \mathrm {f o r} \\ Q _ {n + 1} = Q ^ {(K)}. \\ \end{array} +$$ + +For underdamped Langevin dynamics a common way of building discretization schemes is via the use of splitting methods (Leimkuhler & Matthews, 2016). For the constrained underdamped Langevin system (12) an ABO splitting strategy under $0 = g(q_{t})$ , $0 = \nabla_{q}g(q_{t})p_{t}$ gives: + +A: $\mathrm{d}q_{t} = p_{t}\mathrm{d}t$ $\mathrm{d}p_{t} = -\nabla_{q}g(q_{t})\mathrm{d}\lambda_{t},$ + +B: $\mathrm{d}q_{t} = 0$ $\mathrm{d}p_{t} = -\nabla_{q}V(q_{t})\mathrm{d}t - \nabla_{q}g(q_{t})\mathrm{d}\mu_{t},$ (13) + +O: $\mathrm{d}q_{t} = 0$ , $\mathrm{d}p_{t} = -\gamma p_{t}\mathrm{d}t + \sqrt{2\gamma\tau}\mathrm{d}\mathcal{W}_{t} - \nabla g(q_{t})\mathrm{d}\nu_{t}$ + +In the specific case $\tau = 0$ and by re-scaling $\mu = e^{-\gamma h} / h$ and $\delta t = h^2$ , an OBA sequence is equivalent to the standard PyTorch form of SGD with momentum $\mu$ and stepsize $\delta t$ (Paszke et al., 2017; Leimkuhler et al., 2019). As alternative one could use a symmetric splitting method, e.g. BAOAB method (Leimkuhler et al., 2016), but this would lose its accuracy order advantage in the presence of gradient noise. + +In (13) the B and O components can be solved exactly (in law) while the A component can be approximated using a standard scheme for constrained ODEs (e.g. SHAKE or RATTLE (Leimkuhler & Reich, 2004)[Chap. 7]). Importantly, the A component does not involve the evaluation of the gradient. For circle constraints the A step can be solved explicitly and the corresponding algorithm is provided in detail in Appendix B.4. For orthogonality constraints all details are provided in Appendix B.6, but we will provide the algorithm here. For $Q \in \Sigma$ , the projection onto the cotangent space $T_{Q}^{*}\Sigma$ is defined as $\Pi_{Q}: \mathbb{R}^{r \times s} \to \mathbb{R}^{r \times s}$ , + +$$ +\bar {P} \mapsto \Pi_ {Q} \bar {P} = \bar {P} - \frac {1}{2} Q \left(\bar {P} ^ {T} Q + Q ^ {T} \bar {P}\right). \tag {14} +$$ + +We initialize the parameters and momenta (using projection (14)) to obey the constraint. Then the ABO steps $(Q_{n},P_{n})\in T^{*}\Sigma \mapsto (Q_{n + 1},P_{n + 1})\in T^{*}\Sigma$ are given by Algorithm 2, where $\tilde{G} (Q)$ is the gradient of the loss evaluated on a subset of the data. More details in Appx. B. + +# 5. Numerical Experiments + +The use of constraints can enhance generalization performance. We support this claim by comparing the performance of neural network architectures trained using the constrained approaches described in this paper to nets trained using unconstrained SGD. We typically set $\tau = 0$ and use + +# Algorithm 2 Orthog. constraint underdamped Langevin + +# Every step: + +$$ +\left. \begin{array}{l} Q ^ {(0)} = Q _ {n} + h P _ {n}, \\ \text {f o r} k = 0 \text {t o} K - 1 \text {d o} \\ Q ^ {(k + 1)} = Q ^ {(k)} - \frac {1}{2} Q _ {n} \left(\left(Q ^ {(k)}\right) ^ {T} Q ^ {(k)} - I _ {s}\right), \\ \text {e n d f o r} \\ Q _ {n + 1} = Q ^ {(K)}, \bar {P} _ {n + 1} = P _ {n} + \frac {1}{h} \left(Q _ {n + 1} - Q ^ {(0)}\right), \\ P _ {n + 1} = \Pi_ {Q _ {n + 1}} \bar {P} _ {n + 1} \\ \bar {P} _ {n + 1} = P _ {n} - h \tilde {G} (Q _ {n}), \\ P _ {n + 1} = \Pi_ {Q _ {n}} \bar {P} _ {n + 1}, \\ P _ {n + 1} = e ^ {- \gamma h} P _ {n} + \sqrt {\tau \left(1 - e ^ {- 2 \gamma h}\right)} R _ {n}, \\ P _ {n + 1} = \Pi_ {Q _ {n}} \bar {P} _ {n + 1} \end{array} \right\} (\mathrm {A}) +$$ + +equivalent learning rates to present a fair comparison between constrained and unconstrained approaches. We denote our circle and orthogonal Constrained overdamped Langevin Algorithms as c-CoLA- $od$ and o-CoLA- $od$ , respectively. We compare underdamped variants (CoLA- $ud$ ) with SGD with momentum (SGD-m). + +# 5.1. Orthogonality Constraints + +In Fig. 4 we want to train a multi-layer perceptron (MLP) with $p$ hidden layers on a tightly wound spiral binary classification problem (Fig. D1) and compare the performance of SGD with our orthogonality-preserving overdamped Langevin method o-CoLA-od. For SGD we show results for i) standard PyTorch initialization, ii) orthogonal initialization, and iii) orthogonal regularization ('soft constraint'), where a penalty term is added to the loss to encourage orthogonality of the NN weight matrices. Our o-CoLA-od method clearly outperforms all of these variants in terms of test accuracy for MLPs with more than 3 hidden layers. In Appx. D (Fig. D2) we show that the use of a small temperature perturbation can speed up training even further and slightly increase the test accuracy. The performance of the soft constraint approach can be somewhat improved by lowering the stepsize, yet cannot match the performance of o-CoLA-od (see Figure 5). This illustrates the undesirable stiffness introduced into the system by using penalty-based regularization. The use of o-CoLA-od also removes the need to tune an additional parameter (the penalty strength). + +For a ResNet-34 architecture with BatchNorm and learning rate (LR) decay on CIFAR-10 (Krizhevsky & Hinton, 2009) data our underdamped orthogonal constrained method, without weight decay (WD) significantly outperforms SGD-m without WD (Fig. 6). The overdamped case is presented in the supplement, Fig. D3. In future work we will explore the nuances of combining orthogonality constraints with BatchNorm, residual connections and LR decay. + +![](images/09e58417be545843233ad451a2954dd5271fd117bacc15809bcf7ebfa9fb4e96.jpg) +Figure 4. Test acc. of MLPs with $p$ -number of 100-node hidden layers (HL), ReLU activation. The MLPs are trained on a 4-turn spiral dataset (Fig. D1) using SGD with standard initialization (1st column), SGD with orthogonal initialization (2nd col.), SGD with orthogonal regularization ('soft constraint') by adding a penalty term with strength $\lambda$ to the loss (3rd col.), and o-CoLA-od with $\tau = 0$ (4th col.). For the orthogonal regularization approach and o-CoLA-od we constrain weights in all layers, apart from input and output layers. We set stepsize $h = 0.1$ for all methods and use $5\%$ subsampling. We found the optimal penalty strength $\lambda = 0.05$ for the orthogonal regularization method through line search. Results are averaged over 10 runs. We observe that our o-CoLA-od method significantly outperforms unconstrained SGD and SGD with a soft constraint for MLPs with more than 3 hidden layers. + +# 5.2. Circle Constraints + +We evaluate our circle constrained c-CoLA-ud method on the Fashion-MNIST data set (Xiao et al., 2017). We reduce the amount of training data to 10K samples and use the remaining 60K samples as test data. c-CoLA-ud clearly outperforms SGD-m in terms of both test accuracy and test loss for a 1000-node single hidden layer perceptron (see Fig. 7). The lower test loss of c-CoLA-ud is maintained during training and the method shows no signs of overfitting, thus eliminating the need for early stopping. Even with weight decay, SGD-m is outperformed by its constrained counterpart (for more detailed hyperparameter studies see Appx. D). We also show that a small transformer (Vaswani et al., 2017) with 2 encoder layers (each with 2-head self-attention and 200-node feed-forward network) trained using c-CoLA-ud achieves a lower validation loss on NLP datasets than its unconstrained counterpart, SGD-m (Table 2). + +# 6. Conclusion + +We provide a general framework that can be used to directly influence the parameter space of deep neural networks. The constrained SDE-based algorithms described in this paper allow for the use of additive noise to enhance exploration but can also be used directly in combination with standard SGD approaches. We provide a mathematical framework to study these regularized training methods as discretizations of constrained Langevin dynamics and provide detailed discretization schemes (see Appendix B). As specific examples of constraints we consider circle and orthogonality constraints, which obtain improved generalization performance on classification tasks compared to unconstrained SGD and soft constraint approaches. Further uses of our general framework are left for future work. + +Table 2. Minimum val. loss on Penn Treebank data (batchsize 1024) (Marcus et al., 1993) and Wikitext-2 (batchsize 128) (Merit et al., 2017) using a transformer trained using c-CoLA-ad or SGDm. Hyperpar. c-CoLA-ad: $h = 0.4, r = 0.5, r_L = 0.1, r_N = 1, r_A = 1, \tau = 0, \gamma = 0.5$ (Treebank) and $\gamma = 1$ (Wikitext-2), where the subscripts $L, N, A$ represent the radii belonging to the linear, norm and self-attention layers respectively. The transformer trained using c-CoLA-ad obtains lower validation losses. Studies with weight decay are provided in the supplement. + +
OptimizerPenn TreebankWikitext-2
c-CoLA-ud4.815.09
SGD h = 0.1
mom = 0.74.875.13
mom = 0.84.835.13
mom = 0.94.845.13
SGD h = 0.2
mom = 0.74.835.13
mom = 0.84.835.14
+ +# Acknowledgements + +The authors wish to thank Gabriel Stoltz and Tony Lelièvre for helpful discussions on constrained SDEs. Benedict Leimkuhler is a fellow of the Alan Turing Institute which is supported by EPSRC grant EP/N510129/1. During the creation of this paper Timothee Pouchon was supported by the Swiss National Science Foundation, project P2ELP2_188037. Tiffany Vlaar is supported by The Maxwell Institute Graduate School in Analysis and its Applications, a Centre for Doctoral Training funded by the UK Engineering and Physical Sciences Research Council (grant EP/L016508/01), the Scottish Funding Council, Heriot-Watt University and the University of Edinburgh. + +![](images/44e37c219b4642d08568cb158177a167d547430b3c9beef2c83a7eeab8a4c53b.jpg) +Figure 5. Same set-up as for Figure 4. MLPs with varying numbers of hidden layers (HL) were trained using o-CoLA-od with $h = 0.1$ (right-most) and using SGD with a penalty term added to the loss (results are presented in the 1st three columns with varying stepsizes $h$ and penalty strengths $\lambda$ ). Results are averaged over 10 runs. We illustrate that the use of a penalty-based soft constraint introduces an undesirable stiffness into the system, needing the stepsize to be lowered to improve performance and to allow for the use of larger penalty strengths. The soft constraint approach is unable to reach the same performance as our o-CoLA-od method (right-most) and its performance is heavily dependent on the choice of penalty strength and step size. + +![](images/2e5c5aabe1f0ef6e4ca4ee5802273eaa3db34b1865ad143af4b499e290f85fd3.jpg) + +![](images/17d758b01fe7f8e73963025eec57b7e1007ec0faf79888def1cc37c773685cb5.jpg) + +![](images/56590481c6d8a9e59be9cd584a072744190e0ed8b5ad9af61af7f6e34960ed47.jpg) + +![](images/1565a5e3f97804d2517b443a05ec02e2bb20cde5da642fc7e5c0ea313f113fb0.jpg) +Figure 6. Train (left) & test (middle) loss and test accuracy (right) averaged over 5 runs of a ResNet-34 with BatchNorm trained using SGD-m vs. o-CoLA-ud with $\tau = 0$ on CIFAR-10. For SGD we initially use $h = 0.1$ and decay by a factor 10 every 50 epochs (indicated by the vertical black dotted lines). We set momentum $= 0.9$ and present results with and without WD. o-CoLA-ud (with $\gamma = 0.5$ ) did not use WD. Its learning rate was re-scaled to match the parameters of SGD-m and used the same LR schedule. The o-CoLA-ud method without weight decay strongly outperforms SGD-m without weight decay. + +![](images/f542d0955d694387706ddf05bf547a4ef623eb2c77c8310719ff5d781f1785a1.jpg) + +![](images/343822f027eb7bda38b53b35c7d021d3d88f139d12781950f09b85eb4ddee771.jpg) + +![](images/de06ec9d9e12a0cd05b5cb740c5111359803404b07bfb44a2bebc331a0c49c9c.jpg) +Figure 7. Test loss (left) and test accuracy (right) averaged over 5 runs of a 1000-node SHLP trained using SGD-m vs. c-CoLA-ad on Fashion-MNIST (batchsize 128, number of training data samples reduced to 10K). After a line search we chose the best performing hyperparameter setting for SGD, namely $h = 0.1$ , $mom = 0.8$ , and varied the amount of weight decay (WD). Standard deviations are provided in the supplement. Hyperparameters c-CoLA-ad: $h = 0.3$ , $\gamma = 1$ , $r_0 = 0.05$ , $r_1 = 0.1$ , $\tau = 0$ . Due to the small training dataset size both methods quickly reached $100\%$ training accuracy, but c-CoLA-ad is superior in its test loss and test accuracy. + +![](images/22e55ed8b07ff37bab6aa9781886f397b6a999cc5834c9a06cd4246551d95cde.jpg) + +# References + +Arjovsky, M., Shah, A., and Bengio, Y. Unitary evolution recurrent neural networks. In International Conference on Machine Learning, pp. 1120-1128, 2016. +Bakry, D. and Emery, M. Diffusions hypercontractives. In Azéma, J. and Yor, M. (eds.), Séminaire de Probabilités XIX 1983/84, pp. 177-206, Berlin, Heidelberg, 1985. Springer Berlin Heidelberg. ISBN 978-3-540-39397-9. +Bakry, D., Gentil, I., and Ledoux, M. Analysis and geometry of Markov diffusion operators, volume 348. Springer Science & Business Media, 2013. +Bansal, N., Chen, X., and Wang, Z. Can we gain more from orthogonality regularizations in training deep CNNs? In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 4266-4276, 2018. +Beskos, A., Pillai, N., Roberts, G., Sanz-Serna, J.-M., and Stuart, A. Optimal tuning of the hybrid Monte Carlo algorithm. Bernoulli, 19(5A):1501-1534, 2013. +Bhattacharya, R. N. On the functional central limit theorem and the law of the iterated logarithm for Markov processes. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 60(2):185-201, 1982. +Bou-Rabee, N. and Sanz-Serna, J. Geometric integrators and the Hamiltonian Monte Carlo method. Acta Numerica, 27:113-206, 2018. +Brock, A., Lim, T., Ritchie, J. M., and Weston, N. J. Neural photo editing with introspective adversarial networks. *ICLR*, 2017. +Chaudhari, P., Choromanska, A., Soatto, S., LeCun, Y., Baldassi, C., Borgs, C., Chayes, J., Sagun, L., and Zecchina, R. Entropy-SGD: Biasing gradient descent into wide valleys. *ICLR*, 2017. +Cheng, X., Chatterji, N. S., Bartlett, P. L., and Jordan, M. I. Underdamped Langevin MCMC: A non-asymptotic analysis. arXiv:1707.03663, 2017. +Choromanska, A., Henaff, M., Mathieu, M., Arous, G. B., and LeCun, Y. The loss surfaces of multilayer networks. AISTATS, 2015. +d'Ascoli, S., Sagun, L., Bruna, J., and Biroli, G. Finding the needle in the haystack with convolutions: on the benefits of architectural bias. NeurIPS, 2019. +Faou, E. and Lelievre, T. Conservative stochastic differential equations: Mathematical and numerical analysis. Mathematics of computation, 78(268):2047-2074, 2009. + +Graham, M. and Storkey, A. Asymptotically exact inference in differentiable generative models. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54, pp. 499-508, 2017. +He, K., Zhang, X., Ren, S., and Sun, J. Delving deep into rectifiers: Surpassing human-level performance on Imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026-1034, 2015. +Hoerl, A. and Kennard, R. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12: 55-67, 1970. +Huang, L., Liu, X., Lang, B., Wei Yu, A., and Li, B. Orthogonal weight normalization: Solution to optimization over multiple dependent stiefel manifolds in deep neural networks. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448-456, 2015. +Jastrzegski, S., Kenton, Z., Arpit, D., Ballas, N., Fischer, A., Bengio, Y., and Storkey, A. Three factors influencing minima in SGD. ICANN, 2018. +Jia, K., Li, S., Wen, Y., Liu, T., and Tao, D. Orthogonal deep neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. +Kawaguchi, K. Deep learning without poor local minima NeurIPS, 2016. +Keskar, N., Mudigere, D., Nocedal, J., and M. Smelyanskiy, P. T. On large-batch training for deep learning: Generalization gap and sharp minima. *ICLR*, 2017. +Kipnis, C. and Varadhan, S. R. S. Central limit theorem for additive functionals of reversible Markov processes and applications to simple exclusions. Communications in Mathematical Physics, 104(1):1-19, 1986. +Kirkpatrick, S., Gelatt, C., and Vecchi, M. Optimization by simulated annealing. Science, 220:671-680, 1983. +Krizhevsky, A. and Hinton, G. Learning multiple layers of features from tiny images. 2009. +Leimkuhler, B. and Matthews, C. Molecular Dynamics: With Deterministic and Stochastic Numerical Methods. Interdisciplinary Applied Mathematics. Springer, 2015. +Leimkuhler, B. and Matthews, C. Efficient molecular dynamics using geodesic integration and solvent-solute + +splitting. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 472(2189): 20160138, 2016. +Leimkuhler, B. and Reich, S. Simulating Hamiltonian dynamics, volume 14. Cambridge university press, 2004. +Leimkuhler, B., Matthews, C., and Stoltz, G. The computation of averages from equilibrium and nonequilibrium Langevin molecular dynamics. *IMA Journal of Numerical Analysis*, 36(1):13-79, 2016. +Leimkuhler, B., Matthews, C., and Vlaar, T. Partitioned integrators for thermodynamic parameterization of neural networks. Foundations of Data Science, 1(4):457-489, 2019. +Lelièvre, T. and Stoltz, G. Partial differential equations and stochastic methods in molecular dynamics. Acta Numerica, 25:681-880, 2016. +Lelièvre, T., Stoltz, G., and Rousset, M. Free energy computations: A mathematical perspective. Imperial College Press, 2010. ISBN 9781848162488. +Lelièvre, T., Rousset, M., and Stoltz, G. Langevin dynamics with constraints and computation of free energy differences. Mathematics of computation, 81(280):2071-2125, 2012. +Lelièvre, T., Stoltz, G., and Zhang, W. Multiple projection MCMC algorithms on submanifolds. arXiv:2003.09402, 2020. +Li, Q., Haque, S., Anil, C., Lucas, J., Grosse, R., and Jacobsen, J. Preventing gradient attenuation in Lipschitz constrained convolutional networks. NeurIPS, 2019. +Loshchilov, I. and Hutter, F. Stochastic gradient descent with warm restarts. *ICLR*, 2017. +Marcus, M. P., Santorini, B., and Marcinkiewicz, M. A. Building a large annotated corpus of English: The Penn Treebank. Computational Linguistics, 19(2):313-330, 1993. +Marinari, E. and Parisi, G. Simulated tempering: a new Monte Carlo scheme. *Europhysics Letters*, 1992. +Merit, S., Xiong, C., Bradbury, J., and Socher, R. Pointer sentinel mixture models. *ICLR*, 2017. +Neyshabur, B., Tomioka, R., and Srebro, N. In search of the real inductive bias: On the role of implicit regularization in deep learning. In Bengio, Y. and LeCun, Y. (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Workshop Track Proceedings, 2015. + +Pascanu, R., Mikolov, T., and Bengio, Y. On the difficulty of training recurrent neural networks. In International conference on machine learning, pp. 1310-1318, 2013. +Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer, A. Automatic differentiation in PyTorch. 2017. +Pavliotis, G. A. Stochastic processes and applications: diffusion processes, the Fokker-Planck and Langevin equations, volume 60. Springer, 2014. +Pennington, J., Schoenholz, S., and Ganguli, S. Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice. In Advances in Neural Information Processing Systems, pp. 4785-4795, 2017. +Pennington, J., Schoenholz, S., and Ganguli, S. The emergence of spectral universality in deep networks. In International Conference on Artificial Intelligence and Statistics, pp. 1924-1932, 2018. +Persson, P. The level set method. Lecture notes MIT 16.920J / 2.097J / 6.339J, Numerical Methods for Partial Differential Equations, October 2006. +Rodríguez, P., González, J., Cucurull, G., Gonfaus, J. M., and Roca, X. Regularizing CNNs with locally constrained decorrelations. *ICLR*, 2017. +Santurkar, S., Tsipras, D., Ilyas, A., and Madry, A. How does batch normalization help optimization? In Advances in Neural Information Processing Systems, pp. 2483-2493, 2018. +Saxe, A. M., McClelland, J. L., and Ganguli, S. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv:1312.6120, 2013. +Smith, L. N. Cyclic learning rates for training neural networks. Workshop on Application of Computer Vision, 2017. +Srebro, N. and Shraibman, A. Rank, trace-norm and maxnorm. In International Conference on Computational Learning Theory, pp. 545-560. Springer, 2005. +Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958, 2014. +Sutskever, I., Martens, J., Dahl, G., and Hinton, G. On the importance of initialization and momentum in deep learning. ICML, 2013. +Tibshirani, R. Regression shrinkage and selection via the Lasso. Journal of the Royal Statistical Society: Series B (Methodological), 58(1):267-288, 1996. + +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998-6008, 2017. +Villani, C. Hypocoercivity. Memoirs of the American Mathematical Society, 202(950), 2009. +Vorontsov, E., Trabelsi, C., Kadoury, S., and Pal, C. On orthogonality and learning recurrent networks with long term dependencies. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3570-3578. JMLR.org, 2017. +Welling, M. and Teh, Y. W. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 681-688, 2011. +Wenzel, F., Roth, K., Veeling, B. S., Swiatkowski, J., Tran, L., Mandt, S., Snoek, J., Salimans, T., Jenatton, R., and Nowozin, S. How good is the Bayes posterior in deep neural networks really? arXiv:2002.02405, 2020. +Williams, P. Bayesian regularization and pruning using a Laplace prior. Neural computation, 7(1):117-143, 1995. +Wilson, A., Roelofs, R., Stern, M., Srebro†, N., and Recht, B. The marginal value of adaptive gradient methods in machine learning. *NeurIPS*, 2017. +Wu, L., Zhu, Z., and E, W. Towards understanding generalization of deep learning: Perspective of loss landscapes. ICML, 2017. +Xiao, H., Rasul, K., and Vollgraf, R. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747, 2017. +Xiao, L., Bahri, Y., Sohl-Dickstein, J., Schoenholz, S., and Pennington, J. Dynamical isometry and a mean field theory of CNNs: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, pp. 5393-5402, 2018. +Xie, D., Xiong, J., and Pu, S. All you need is beyond a good init: Exploring better solution for training extremely deep convolutional neural networks with orthonormality and modulation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6176-6185, 2017. +Yao, Z., Gholami, A., Keutzer, K., and Mahoney, M. PyHessian: Neural networks through the lens of the Hessian. arXiv:1912.07145, 2019. +Zappa, E., Holmes-Cerfon, M., and Goodman, J. Monte Carlo on manifolds: Sampling densities and integrating + +functions. Communications on Pure and Applied Mathematics, 71(12):2609-2647, 2018. +Zhang, S., Choromanska, A., and LeCun, Y. Deep learning with elastic averaging SGD. NeurIPS, 2015. +Zhou, J., Do, M., and Kovacevic, J. Special paraunitary matrices, Cayley transform, and multidimensional orthogonal filter banks. IEEE Transactions on Image Processing, 15(2):511-519, 2006. \ No newline at end of file diff --git a/bettertrainingusingweightconstrainedstochasticdynamics/images.zip b/bettertrainingusingweightconstrainedstochasticdynamics/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d746fa20e87d6ca9c575eedc78182060280a2e33 --- /dev/null +++ b/bettertrainingusingweightconstrainedstochasticdynamics/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:780b2d6a131f36cc6dbea176d0c86b6456567267538a9e9f0fbd270ce7016640 +size 774545 diff --git a/bettertrainingusingweightconstrainedstochasticdynamics/layout.json b/bettertrainingusingweightconstrainedstochasticdynamics/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..64212d307961b3c69cb3f93da7cd6f5e9d79a9ed --- /dev/null +++ b/bettertrainingusingweightconstrainedstochasticdynamics/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:000f0e8a0db974380f699fe4456d801ba72576f58dc7fdc5423fac576033328a +size 529839 diff --git a/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_content_list.json b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d3d494f11855f9c0af7aec24e040c9f69d1a1c2e --- /dev/null +++ b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3cdff9d06456f1a22db4e3060ea3d3c3b833fe93855ca50510d5a7b48de1424 +size 83042 diff --git a/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_model.json b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f29c307376e7efda3a20e94117e80b1125a3a13d --- /dev/null +++ b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90b23308072f6fbbc5a5d3ee7f29a6b7476c4ebccc9b4085d641b892232ad9d2 +size 100621 diff --git a/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_origin.pdf b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..90351f7b70abd3cf97fb16fddbbd98363e8e16f6 --- /dev/null +++ b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/c533967b-d773-4df6-aedc-f08ed1412199_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cb50c120eaa50ba3e866e20146af4bd644425e0bebe34d57201473e84a8f6e1 +size 6330894 diff --git a/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/full.md b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/full.md new file mode 100644 index 0000000000000000000000000000000000000000..77f216f27f96670ddaad4a6bede4b1ee18e02ddf --- /dev/null +++ b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/full.md @@ -0,0 +1,363 @@ +# Beyond $\log^2 (T)$ Regret for Decentralized Bandits in Matching Markets + +Soumya Basu $^{1}$ Karthik Abinav Sankararaman $^{2}$ Abishek Sankararaman $^{3}$ + +# Abstract + +We design decentralized algorithms for regret minimization in two-sided matching markets with one-sided bandit feedback that significantly improves upon the prior works (Liu et al., 2020a; Sankararaman et al., 2021; Liu et al., 2020b). First, for general markets, for any $\varepsilon > 0$ , we design an algorithm that achieves a $O(\log^{1 + \varepsilon}(T))$ regret to the agent-optimal stable matching, with unknown time horizon $T$ , improving upon the $O(\log^2(T))$ regret achieved in (Liu et al., 2020b). Second, we provide the optimal $\Theta(\log(T))$ regret for markets satisfying uniqueness consistency – markets where leaving participants don't alter the original stable matching. Previously, $\Theta(\log(T))$ regret was achievable (Sankararaman et al., 2021; Liu et al., 2020b) in the much restricted serial dictatorship setting, when all arms have the same preference over the agents. We propose a phase based algorithm, where in each phase, besides deleting the globally communicated dominated arms, the agents locally delete arms with which they collide often. This local deletion is pivotal in breaking deadlocks arising from rank heterogeneity of agents across arms. We further demonstrate superiority of our algorithm over existing works through simulations. + +# 1. Introduction + +Decentralized decision making by competing agents under uncertainty, each one motivated by one's own objective, is a key feature in online market places, e.g. TaskRabbit, UpWork, DoorDash. An emerging line of research (Aridor et al., 2020; Johari et al., 2021; Liu et al., 2020a; Sankararaman et al., 2021; Liu et al., 2020b) in the field of multi-agent + +1Google, Mountain View, CA, USA 2Facebook, Menlo Park, CA, USA 3Amazon, Palo Alto, CA, USA. Correspondence to: Soumya Basu , Karthik Abinav Sankararaman , Abishek Sankararaman . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +bandits is dedicated to understanding algorithmic principles in the interplay of competition, learning and regret minimization. The two-sided matching market (Gale & Shapley, 1962) is one such thread, where regret minimization is first studied in (Liu et al., 2020a) with a centralized arbiter, and in (Sankararaman et al., 2021; Liu et al., 2020b) at different levels of decentralization. + +We study the fully decentralized two-sided matching market, comprising of $N$ demand-side entities (a.k.a. agents) and $K$ supply-side entities (a.k.a. arms). Each entity has a separate preference ranking of the opposite side agents, i.e. each agent over $K$ arms, and each arm over $N$ agents, and aims to match with the most preferred entity. In the bandit setting, the agents lack prior knowledge of their respective preferences, thus need to learn the preferences only through their own past interactions, while the arms know their preferences. In each round, every agent simultaneously chooses an arm of their choice, and are either matched to their arm of choice and receive a stochastic reward (reward defines agents' preference); or are blocked, are notified of this, and receive no reward. + +A matching between agents and arms is stable if there exist no pair of agents and arms that are not matched with each other under the matching, prefer each other over their current partners. When each participant knows its preference and the agents propose to the arms across multiple rounds, the system admits any stable matching as a Nash equilibrium. Further, the agent-optimal stable matching is the one, which yields the highest reward among multiple possible stable matchings, to all agents (Gale & Shapley, 1962). Our objective is to design a uniform protocol for the agents, which allows each agent to quickly find and match with its agent-optimal arm, thus maximizing their cumulative reward. + +Under a restrictive special case, known as serial dictatorship, where all arms have the same preference (Sankararaman et al., 2021) shows it is possible for each agent to attain $O(NK\log (T))$ cumulative regret (the gap between optimal and achieved reward) in $T$ rounds. They rely on an Upper confidence bound (UCB) based algorithm, called UCB-D3, that uses strategic deletion of arms done through global communication alongside UCB based explore-exploit. When the decentralization is relaxed, and each agent observes the + +response of all the arms per round, (Liu et al., 2020b) designs Collision Avoidance UCB (CA-UCB), which avoids collision by arm deletion and reduced switching of arms. This provides $O(\exp(N^4) \log^2(T))$ regret for each agent with respect to an agent-pessimial stable matching. Under agent-pessimial stable matching, all the agents obtain the minimum reward among all stable matching, thus it is less desirable than the agent-optimal stable matching. Moreover, the relaxation of decentralization comes at the cost of privacy, and the possible lack of truthfulness of agents which can hurt the performance, and discourage participation. + +Our first contribution is to show through a simple phase based explore then commit protocol each agent can achieve $O(K\log^{1 + \varepsilon}(T))$ regret for any $\varepsilon > 0$ , for sufficiently large time horizon $T$ . We further focus on two-sided markets that satisfy uniqueness consistency (UnqC) (Karpov, 2019), where the stable match is robust —namely if any subset of matched pairs of a stable match leave, the remaining matches are still stable. This also relaxes the stringent requirement of homogeneous preferences imposed by the serial dictatorship model. Arguably, robustness to matches departing the system and heterogeneity of preferences is a desirable property in large dynamic markets such as TaskRabbit, InstaCart etc. Under UnqC, where UCB-D3 fails due to heterogeneous arm ranking, we design UCB-D4 (UCB-D3 augmented with local deletions) that allows each agent to achieve $O(NK\log(T))$ regret. In local deletion, an agent aggressively and locally removes the arms to which it collides above a well designed threshold. + +# 1.1. Main Contributions + +1. General markets. The best existing regret bound for general stable matching due to (Liu et al., 2020b) obtains a $O(\exp(N^4)\log^2(T))$ agent-pessimial regret under partial decentralized feedback in time horizon $T$ . The CA-UCB algorithm is used where agents switch with very low frequency to the arm with highest UCB index in a carefully chosen subset. The slow switching allows for collision avoidance but at a cost of high regret. Therefore, we design, phased ETC, a simple phase based algorithm, used uniformly by agents, which sets up a protocol that allows collision free exploration at the beginning of each phase. Then using the Gale-Shapley (Gale & Shapley, 1962) algorithm commits to a stable matching with their individual estimated preference lists. We prove this algorithm achieves a $O(K\log^{1+\varepsilon}(T))$ agent-optimal regret under fully decentralized feedback for any $\varepsilon > 0$ , by setting the exploration duration based on $\varepsilon$ . Although our proposed algorithm beats the state-of-the-art CA-UCB guarantees in many dimensions - fully vs partially decentralized, agent optimal vs pessimal regret, $O(K\log^{1+\varepsilon}(T))$ vs $O(\exp(N^4)\log^2(T))$ - it suffers from cold-start, i.e. it works for $T = \Omega(\exp(N/\Delta^2))$ , where $\Delta$ is the minimum reward gap across all arms and + +agents. This leaves open the quest for an optimal $O(\log (T))$ regret without the curse of cold-start. + +2. Markets with uniqueness consistency. We next focus on markets with uniqueness consistency (or UnqC in short), where there is a unique and robust stable matching. In this setting, the best known result (excluding serial dictatorship) is $O(\exp(N^4) \log^2(T))$ , achieved by CA-UCB. For serial dictatorship, a special case of UnqC where all arms have the same preference order, the best result, $O((j - 1)K \log(T))$ for agent ranked $j$ for all arms, is obtained by UCB-D3. UCB-D3, a phase based algorithm however, cannot incur sub-linear regret when the preferences are heterogeneous (empirically shown in the Section 6). We introduce UCB-D4, a generalization of UCB-D3 that handles heterogeneous arm preferences under uniqueness consistency, and achieves the coveted $O(\log(T))$ regret for any $T = \Omega(N / \Delta^2)$ , i.e. without the cold-start problem. Our key algorithmic and theoretical insights behind this result are as follows. + +Algorithmic. UCB-D4 augments UCB-D3 with a local deletion, where an agent in each phase deletes an arm locally if it experiences collision more than a $(\beta \times$ phase length) times, for an appropriate $\beta > 0$ . The local deletion plays an important role in eliminating deadlocks that can be created under UCB-D3. In particular, consider the case when uniqueness consistency holds. Here arms have heterogeneous preferences, and agent $a$ and agent $b$ can block each other from exploring their non-stable matched arms. Interestingly, we discover that such deadlocks do not occur when playing the stable matched arms. Due to the specific nature of the deadlock, if an agent 'frequently' collides with an arm it is safe to delete that arm locally. The key is to carefully set the threshold of local deletion. A small threshold can remove the stable matched arm with constant probability due to the stochastic feedback, thus incur linear regret. Whereas, a large threshold deter the agent from getting out of the deadlock fast enough to achieve $O(\log (T))$ regret. UCB-D4 with $\beta < 1 / K$ strikes the correct balance. + +Theoretical. We introduce a dual induction proof-technique linked with $\alpha$ -condition. The $\alpha$ -condition bestows two orders: one among agents - left order, and one among arms - right order. In the left order, the agents have their stable matched arm as best arm once the stable matched arms for higher order agents are removed. For the right order, same holds with the roles of agents and arms swapped. Our dual induction uses these two orders. We show local deletion ensures the arms inductively, following the right order, become 'available' for their respective stable matched agents. This allows the agents to inductively, following the left order, identify and broadcast their respective stable matched arm. The second induction, depends on first, and is driven by global deletion of dominated arms, alongside deadlock resolution due to local deletion. + +3. Empirical. We compare the performance of our algorithms against CA-UCB, an algorithm for matching markets under partial decentralization: the response of all arms per round is visible. Our proposed phased ETC and UCB-D4 both work under full decentralization: only sees response of the proposed arm. Extensive simulations show, despite the restrictive feedback, phased ETC outperforms CA-UCB in general instances, while UCB-D4 does so under uniqueness consistency. We also empirically validate that UCB-D3 produces linear regret under uniqueness consistency. + +# 1.2. Related Work + +The field of bandit learning has a vast literature with multiple textbooks on this subject (Lattimore & Szeptsvári, 2020; Bubeck & Cesa-Bianchi, 2012; Slivkins, 2019). Our work falls in the multi-agent bandits setting, which is effective in modelling applications like wireless networks (Avner & Mannor, 2016; Darak & Hanawal, 2019), online advertising (Hillel et al., 2013), data-centers and search scheduling (Sankararaman et al., 2019) where multiple decision makers interact causing an interesting interplay of competition, learning and consensus (Boursier & Perchet, 2020; Brânzei & Peres, 2019). The study of multi-agent bandits in two-sided matching markets is initiated by (Liu et al., 2020a). They study the centralized setting, when the agents pass on their estimated preference to a single decision maker who then proposes to the arms. In this setting, the authors design a UCB based protocol that completely avoids collision (due to centralized proposals) and attains a $O(NK\log(T))$ regret with respect to the agent-pessimial stable matching. The papers of (Sankararaman et al., 2021) and (Liu et al., 2020b) are the closest to our work as both of them studies decentralized (the latter only partially) two-sided matching markets. We have already mentioned their relation to this work, and how we improve upon them. Two-sided markets under full information, commonly known as the stable marriage problem was introduced in the seminal work of (Gale & Shapley, 1962) where they established the notion of stability and provided the optimal algorithm to obtain a stable matching. Our results rely on the recent combinatorial characterization, namely $\alpha$ -condition, of UnqC in stable marriage problem by (Karpov, 2019). Further, in the economics literature, uncertainty in two-sided matching have been studied recently in (Johari et al., 2021; Ashlagi et al., 2019) in directions tangential to our work. We provide a detailed related work in Appendix B. + +# 2. System Model + +Agents and arms. We have $N$ agents and $K \geq N$ arms. When agent $j \in [N]$ is matched to arm $k \in [K]$ it receives a reward sampled (independent of everything) from a latent distribution with support $[0,1]$ , and mean $\mu_{jk} \in [0,1]$ . We + +assume that $\{\mu_{jk}\}_{j,k}$ are all distinct. For each agent, the arm means impose a preference order over the arms, with higher means preferred over lower means. Similarly, every arm $k\in [K]$ has a total preference order over the arms $>\operatorname {arm}(k)$ ; for $j,j^{\prime}\in [N]$ , if $\operatorname {agent}(j) > _{\operatorname {arm}(k)}$ agent $(j^{\prime})$ then arm $k$ prefers agent $j$ over $j^{\prime}$ . When context is clear, we use $j$ for agent $(j)$ , and $k$ for $\operatorname {arm}(k)$ . For any subset of agents and arms, the preference profile is the preference order of the agents restricted to the given set of arms, and vice versa. The game proceeds in $T$ rounds (value of $T$ unknown to the agents) where every agent simultaneously plays one arm, and is either matched to that arm or is notified that it was not matched. In every round, each arm is matched to the most preferred agent playing that arm in that round (if any). + +Stable Matching. Given the preference order for agents and arms, consider a matching denoted by the set $\mathbf{k}^*,\mathbf{j}^*$ , with $k_{j}^{*}$ denoting the matched arm for agent $j$ , and $j_{k}^{*}$ denoting the matched agent for arm $k$ . Under a stable-matching there exist no two pairs $(j,k)$ and $(j',k')$ such that $k = k_{j}^{*}$ and $k' = k_{j'}^*$ , but $\mu_{jk} < \mu_{jk'}$ and $\mathrm{agent}(j) > _{\mathrm{arm}(k')} \mathrm{agent}(j')$ if agent $j$ matches with $k'$ both improve their position. An agent-optimal stable match is unique and is one where all agents obtain their respective best possible match among all possible stable matchings (see, (Gale & Shapley, 1962)). + +Decentralized bandit with no information. All agents have common information, that we have $N$ total agents and $K$ arms each labeled 1 through $K$ . In each round, every agent observes only the outcome of its action and cannot observe the other agents' play/outcome. Specifically, when it is rejected by the arm it observes the collision signal, otherwise it observes the reward obtained from the arm it proposed to. Thus, our feedback structure is fully decentralized where in each round, an agent's decision to play an arm to play can depend only on common information before the start, its past actions and outcomes. Agents can however agree to a common protocol that map their observed outcomes to arms in every round. + +Agent optimal regret. Total reward obtained by any agent is compared against that obtained by playing the agent optimal stable match in all rounds. Let $P_{j}(t) \in [K]$ be the arm played by agent $j$ in round $t$ and $M_{j}(t) \in \{0,1\}$ be the indicator random variable denoting whether agent $j$ was matched to $P_{j}(t)$ . Let $k_{j}^{*}$ be the agent-optimal stable match of agent $j$ . The $T$ -round individual regret for an agent is + +$$ +R _ {j} (T) = T \mu_ {j k _ {j} ^ {*}} - \mathbb {E} \left[ \sum_ {t = 1} ^ {T} M _ {j} (t) \mu_ {j P _ {j} (t)} \right]. +$$ + +The goal is to design a protocol that all agents follow to minimize their individual regret. + +We make a few important remarks on the model. + +1. Feedback structure. Our feedback structure is same + +as (Sankararaman et al., 2021), and more restrictive than the one proposed very recently in (Liu et al., 2020b) called decentralized bandit with partial information (see also, Section 6). In the latter, all the agents can observe the matching between arms and agents in each round, alongside it's own reward or collision information. Further, the knowledge of preference order of the arms is explicitly assumed. + +2. Why agent optimal regret? Our rationale for this is to compare against an oracle in which the arm-preferences of the agents are common information known to all agents, and each agent plays to maximize its individual total reward. This corresponds to a repeated game, in which, the set of pure strategy Nash equilibria corresponds to all agents playing a particular stable match in all rounds. The optimal equilibria that maximizes the reward for all agents simultaneously, corresponds to the agent-optimal stable matching. + +3. Model generalizations. We focus on $N \leq K$ , as for $N > K$ some agents will remain unmatched under full information, and have 0 regret by definition. Our algorithms, can be modified easily to handle such cases. Further, we can admit any sub-Gaussian reward distribution with finite mean in place of rewards supported on [0, 1], with minor changes in our proof. + +# 3. Achieving $O(\log^{(1 + \varepsilon)}(T))$ Regret in Matching Markets for $\varepsilon > 0$ + +In this section, we give a simple Phased Explore then Commit (ETC) style algorithm that obtains an asymptotic per-agent regret of $O(\log^{1 + \varepsilon}(T))$ for any given $\varepsilon > 0$ . The algorithm proceeds in phases of exponentially growing lengths, with phase $i$ lasting $2^i$ rounds. In each phase $i \geq 0$ , all agents explore for the first $i^\varepsilon$ rounds, and then subsequently exploit by converging to a stable matching through the Gale-Shapley strategy. The explorations are organized so that the agents avoid collision, which can be done in a simple decentralized fashion, where each agent gets assigned an unique id in the range $\{1, \dots, N\}$ (Algorithm 3 in Appendix A). The pseudo-code for phased ETC is given in Algorithm 1. + +The minimum reward gap across all arms and agents is $\Delta = \min \{|\mu_{jk} - \mu_{jk'}|:j\in [N],k,k'\in [K]\}$ + +Theorem 1. If every agent runs Algorithm 1 with input parameter $\varepsilon > 0$ , then the regret of any agent $j$ after $T$ rounds satisfies + +$$ +\begin{array}{l} R _ {T} ^ {(j)} \leq \frac {K (\log_ {2} (T) + 2) ^ {1 + \varepsilon}}{1 + \varepsilon} + (N ^ {2} + K) (\log_ {2} (T) + 2) \\ + 2 ^ {\left(\left(8 / \Delta^ {2}\right) ^ {1 / \varepsilon} 4 ^ {(1 + \varepsilon) / \varepsilon} + 1\right)} + \frac {e}{e - 2}. \\ \end{array} +$$ + +The proof is given in Appendix C. Several remarks are in order now on the regret upper bound of phased-ETC. + +Algorithm 1 Phased ETC Algorithm +1: Index $\leftarrow$ INDEX-ESTIMATION() +2: for $N + 1 \leq t \leq T$ do +3: $i \gets \lfloor \log_2(t - 1) \rfloor$ +4: if $t - 2^i + 1 \leq K \lfloor i^\varepsilon \rfloor$ then +5: Play arm $(t + \text{Index} - 2^i + 1) \mod K$ +6: else +7: Play GALE-SHAPLEY-MATCHING (Gale & Shapley, 1962) of Algorithm 5 with arm-preference ordered by empirical means computed using all the explore samples thus far. +8: end if +9: end for + +1. Comparison with CA-UCB. From an asymptotic viewpoint (when $T \to \infty$ ), our result improves upon the recent result of (Liu et al., 2020b). Their proposed algorithm CA-UCB, achieves a regret of $O(\log^2(T))$ with respect to the agent-pessimal stable matching. Theorem 1 shows that, even under our (restrictive) decentralized bandit model, the phased ETC algorithm achieves $O(\log^{1 + \varepsilon}(T))$ regret with respect to the agent-optimal stable matching. +2. Exponential dependence on gap. The constant in the regret bound has an exponential dependence on $\Delta^{-2}$ , which limits its applicability to practical values of $T$ . We note that, the CA-UCB algorithm proposed in (Liu et al., 2020b), has an exponential dependence on $N^4$ that is multiplied with the $\log^2(T)$ term in their regret bound. It is an interesting open problem, to obtain an algorithm, that obtains $O(\log^{1 + \varepsilon}(T))$ regret for the general matching bandit case, without any exponential dependence. +3. Comparison with Single Phase ETC. An ETC algorithm was proposed in (Liu et al., 2020a), which requires the knowledge of minimum reward gap $(\Delta)$ and the time horizon $(T)$ to compute the necessary exploration. We remove the dependence on the reward gap and time horizon by our interleaved exploration and exploitation in the phased-ETC. + +In the following section, we present UCB-D4 — UCB-D3 with Local Deletion, a decentralized algorithm that achieves regret scaling as $O\left(\frac{\log(T)}{\Delta^2}\right)$ without any exponential dependence on problem parameters, whenever the underlying system satisfies uniqueness consistency. + +# 4. Achieving $O(\log (T))$ Regret under Uniqueness Consistency + +We first introduce the uniqueness consistency in stable matching systems, and provide known combinatorial characterization of such systems, before presenting our algorithm. + +Uniqueness Consistency. The uniqueness consistency is an + +important subclass of graphs with unique stable-matching, and is defined as below after (Karpov, 2019). + +Definition 1 ((Karpov, 2019)). A preference profile satisfies uniqueness consistency iff (i) there exists a unique stable matching $(\mathbf{k}^{*},\mathbf{j}^{*})$ ; (ii) for any subset of arms or agents, the restriction of the preference profile on this subset with their stable-matched pair according to $(\mathbf{k}^{*},\mathbf{j}^{*})$ has a unique stable matching. + +The uniqueness consistency implies that even if an arbitrary subset of agent leaves the system with their respective stable matched arms, we are left with a system with unique stable matching among the rest of agents and arms. This allows for any algorithm, which is able to identify at least one stable pair in a unique stable-matching system, to iteratively lead the system to the global unique stable matching. + +Combinatorial characterization. In (Karpov, 2019), a necessary and sufficient condition for the uniqueness consistency of the stable matching system is established in the form of $\alpha$ -condition (defined shortly). However, in order to connect $\alpha$ -condition with the serial dictatorship studied in (Sankararaman et al., 2021), we find it instructive to first present the sequential preference condition (SPC) (Eeckhout, 2000), a generalization of serial dictatorship, before defining the $\alpha$ -condition in full generality. The definition of SPC (Eeckhout, 2000) (which is stated in terms of men and women preferences) restated in our system where we have agents and arms is as follows. + +Let $\sigma$ denote a pair of permutations of $[N]$ and $[K]$ . Then $[K]_{\sigma} = \{a_1^{(\sigma)}, \ldots, a_K^{(\sigma)}\}$ and $[N]_{\sigma} = \{A_1^{(\sigma)}, \ldots, A_N^{(\sigma)}\}$ denote permutations of the ordered sets $[K]$ and $[N]$ , respectively. The $k$ -th arm in $[K]_{\sigma}$ is the $a_k^{(\sigma)}$ -th arm in $[K]$ , and the $j$ -th agent in $[N]_{\sigma}$ is the $A_j^{(\sigma)}$ -th agent in $[N]$ . + +Definition 2. Sequential preference condition (SPC) is satisfied iff there is an order of agents and arms so that + +$$ +\begin{array}{l} \forall j \in [ N ] _ {\mathrm {s p c}}, \forall k \in [ K ] _ {\mathrm {s p c}}, k > j,: \mu_ {j j} > \mu_ {j k}, a n d \\ \forall k \leq N, \forall j \in [ N ] _ {\text {s p c}}, j > k: \operatorname {a g e n t} j _ {k} ^ {*} > _ {\operatorname {a r m} k} \operatorname {a g e n t} j. \\ \end{array} +$$ + +We next introduce a generalization of the SPC condition known as $\alpha$ -condition. This was first introduced in (Karpov, 2019) recently, and shown to be the weakest sufficient condition for a market to admit an unique stable matching. We again restate the definition from (Karpov, 2019) in our scenario. + +Definition 3. The $\alpha$ -condition is satisfied iff there is a stable matching $(\mathbf{k}^*, \mathbf{j}^*)$ , a left-order of agents and arms + +$$ +s. t. \forall j \in [ N ] _ {l}, \forall k > j, k \in [ K ] _ {l}: \mu_ {j k _ {j} ^ {*}} > \mu_ {j k}, +$$ + +and a (possibly different) right-order of agents and arms + +$$ +\begin{array}{l} s. t. \forall k < j \leq N, a _ {k} \in [ K ] _ {r}, A _ {j} \in [ N ] _ {r}: \\ \operatorname {a g e n t} A _ {j _ {a _ {k}} ^ {*}} > _ {\operatorname {a r m} a _ {k}} \operatorname {a g e n t} A _ {j}. \\ \end{array} +$$ + +The following theorem in (Karpov, 2019) provides the characterization of uniqueness consistency, where unacceptable mates are absent (an unacceptable pair $(j,k)$ means agent $j$ does not accept arm $k$ , or the vice versa).1 + +Theorem 2 ((Karpov, 2019)). If there is no unacceptable mates, then the $\alpha$ -condition is a necessary and sufficient condition for the uniqueness consistency. + +Without loss of generality, henceforth we consider the SPC order to be identity, i.e. $[N]_{\mathrm{spc}} = [N]$ and $[K]_{\mathrm{spc}} = [K]$ . Again, without loss of generality we consider the left order in the $\alpha$ -condition to be identity, i.e. $[N]_l = [N]$ and $[K]_l = [K]$ . Therefore, for the rest of the paper we only deal with arm order $a_{k}^{(r)} = a_{k}$ and agent order $A_{j}^{(r)} = A_{j}$ , for arm $k \in [K]$ and agent $j \in [N]$ . + +We end with a few remarks on these three systems. + +1. Serial Dictatorship, SPC, and $\alpha$ -condition. As mentioned earlier, the $\alpha$ -condition generalizes SPC. SPC is satisfied when the left order is identical to the right order in $\alpha$ -condition. Further, SPC generalizes serial dictatorship, as the unique rank of the agents in the latter and their respective stable matched arms creates an SPC order. We present examples of the three systems. + +1. This system is Serial dictatorship, SPC, and $\alpha$ -condition + +$$ +\operatorname {a g e n t}: a: 1 > 2 > 3, b: 1 > 2 > 3, c: 2 > 1 > 3, +$$ + +$$ +\operatorname {a r m}: 1: a > b > c, 2: a > b > c, 3: a > b > c. +$$ + +2. This system is not Serial dictatorship as arms do not have a unique rank. But it satisfies SPC and $\alpha$ -condition, with a valid SPC order $\{(a,1),(b,2),(c,3)\}$ . + +$$ +\operatorname {a g e n t}: a: 1 > 2 > 3, b: 1 > 2 > 3, c: 2 > 1 > 3, +$$ + +$$ +\operatorname {a r m}: 1: a > b > c, 2: a > b > c, 3: a > c > b. +$$ + +3. The third system is not Serial dictatorship or SPC as there is no SPC order. But it satisfies $\alpha$ -condition as a valid left order is $\{(a,1), (b,2), (c,3)\}$ , and the corresponding right order is $\{(b,2), (c,3), (1,a)\}$ . + +$$ +\operatorname {a g e n t}: a: 1 > 2 > 3, b: 1 > 2 > 3, c: 2 > 1 > 3, +$$ + +$$ +\operatorname {a r m}: 1: b > c > a, 2: b > a > c, 3: b > c > a. +$$ + +Currently, the $\alpha$ -condition is the weakest sufficient condition for uniqueness of stable matching. Necessary condition for the uniqueness of stable matching remains elusive and is a long standing open problem in combinatorics. + +2. Stable matching under SPC and $\alpha$ -condition. The definition of SPC implies that the unique stable matching is + +obtained when, under the SPC order, for every $i \leq N$ , the agent $i$ is matched to the arm $i$ . Furthermore, under $\alpha$ -condition for any $j \in [N]$ , the agent $j$ is matched with arm $j$ , and the agent $A_{j}$ is matched with the arm $a_{j}$ in the stable matching. We present a proof in the Appendix E. + +# 4.1. UCB-D4: UCB Decentralized Dominate-Delete with Local Deletions + +In this section, we describe our main algorithm. The algorithm applies a novel technique called local deletions that interleaves with the phased global deletion strategy of UCB-D3 algorithm proposed in (Sankaraman et al., 2021). Algorithm 2 describes this algorithm in detail. + +Algorithm 2 UCB-D4 algorithm (for an agent $j$ ) +1: Input: Parameters $\beta \in (0,1 / K)$ , and $\gamma > 1$ +2: Set Index $(j) \gets$ INDEX-ESTIMATION() +3: Global deletion $G_{j}[0] = \phi$ , $\forall j \in [N]$ +4: for phase $i = 1,2,\ldots$ do +5: Reset the collision counters $C_{jk}[i] = 0, \forall k \in [K]$ +6: Delete dominated arms, $\mathcal{A}_{j}[i] \gets [K] \setminus G_{j}[i - 1]$ +7: if $t < 2^{i} + N + NK(i - 1)$ then +8: Local deletion $L_{j}[i] \gets \{k : C_{jk}[i] \geq |\beta 2^{i}|\}$ +9: Play an arm $P_{j}(t) \in \arg \max_{k \in \mathcal{A}_{j}[i] \setminus L_{j}[i]} (\widehat{\mu}_{k,j}(t - 1) + \sqrt{\frac{2\gamma \log(t)}{N_{k,j}(t - 1)}})$ +10: if Arm $k = P_{j}(t)$ is matched then +11: Update estimate $\widehat{\mu}_{k,j}$ , and matching count $N_{k,j}$ +12: else +13: Increase collision counter $C_{jk}[i] \gets C_{jk}[i] + 1$ +14: end if +15: else if $t = 2^{i} + N + NK(i - 1)$ then +16: $\mathcal{O}_{j}[i] \gets$ most matched arm so far in phase $i$ +17: $G_{j}[i] \gets$ COMMUNICATION $(i, \mathcal{O}_{j}[i])$ +18: end if +19: end for + +The index of each agent $j$ , namely $\mathrm{Index}(j)$ , is set as the rank of this agent for the arm 1, which can be learned accurately in $N$ rounds and in a distributed way (details in Algorithm 3 in Appendix A). + +At a high-level, the algorithm proceeds in phases as follows. At each phase $i$ , every agent $j$ first updates its set of active arms for the phase given by $\mathcal{A}_j[i]$ by removing all the arms in the global dominated set $G_j[i - 1]$ . Then for the next $2^i$ time-steps, every agent plays the arm with the highest UCB from its active set $\mathcal{A}_j[i]$ . Here, $\hat{\mu}_{jk}(t)$ denotes the estimated mean reward for, and $N_{jk}(t)$ the number of matches with, arm $k$ by agent $j$ at the end of round $t$ . Whenever the agent collides with an arm at least $\lceil \beta 2^i \rceil$ times (tracked by collision counters $C_{jk}[i]$ ), it removes this arm from the active set. + +Finally, in the last $NK$ steps of this phase, each agent participates in a communication protocol (Algorithm 4 in Appendix A) to update the global dominated sets $G_{j}[i]$ . In the rounds from $(K \times (\mathrm{Index}(j) - 1))$ to $(K \times \mathrm{Index}(j) - 1)$ , agent $j$ proposes to the $K$ arms in round robin order, and adds the rejected arms to its globally dominated set $G_{j}[i]$ . In the remaining rounds, it proposes to its most played arm in phase $i$ , i.e., arm $\mathcal{O}_j[i]$ . We show that the globally dominated set $G_{j}[i] = \{\mathcal{O}_{j^{\prime}}[i]: j^{\prime} > \mathcal{O}_{j^{\prime}}[i] j\}$ . + +# 5. Main Results + +We now present our main result in Theorem 3 which show that UCB-D4 attains near optimal logarithmic regret when the stable matching satisfies uniqueness consistency. + +System parameters. We introduce the following definitions first that will be used in the regret upper bound: + +1. The blocking agents for agent $j \in [N]$ and arm $k \in [K]$ , $\mathcal{B}_{jk} := \{j' : \mathrm{agent}(j') >_{\mathrm{arm}(k)} \mathrm{agent}(j)\}$ . +2. The dominated arms for agent $j \in [N]$ , $\mathcal{D}_j := \{k_{j'}^* : j' \leq j - 1\}$ . +3. The blocked non-dominated arms for agent $j \in [N]$ , $\mathcal{H}_j = \{k : \exists j' \in \mathcal{B}_{jk} : k \notin \mathcal{D}_j \cup \mathcal{D}_{j'}\}$ . +4. The max blocking agent for agent $j \in [N] J_{\max}(j) = \max (j + 1, \{j' : \exists k \in \mathcal{H}_j, j' \in \mathcal{B}_{jk}\})$ . +5. The right-order mapping for $\alpha$ -condition for agent $j \in [N]$ is $lr(j)$ so that $A_{lr(j)} = j$ with $A_j$ as defined in Definition 3. We define the $lr_{\max}(j) = \max \{lr(j'): j' \leq j\}$ . +6. The gaps of each agent $j$ , is given as $\Delta_{jk} = (\mu_{jk_j^*} - \mu_{jk})$ which can be negative for some arms $k$ . We define $\Delta_{\min} = \min \{\Delta_{jk}: j \in [N], k \in [K], \Delta_{jk} > 0\}$ as the minimum positive gap across arms and agents. + +Some comments are due on some of the above definitions. The dominated arms is defined similar to (Sankararaman et al., 2021). These arms may have higher mean, hence higher long term UCB, than the agent's stable matched arm. If not removed, the agent will incur linear regret due to collision from these arms which are played by blocking agents in steady state. The blocked non-dominated arms are absent in serial dictatorship, but in the SPC and $\alpha$ -condition they emerge due to heterogeneity of arm preference orders. These arms are not necessarily removed during the global deletion (i.e. through the set $G_{j}[i]$ in UCB-D4), and may create a deadlock for an agent where the agent keeps playing these arms without exploring them due to collisions. + +Regret bounds. We present the $O(\log (T))$ regret bound for the systems following uniqueness consistency in Theorem 3. + +Theorem 3. For a stable matching instance satisfying $\alpha$ -condition (Definition 3), suppose each agent follows UCB-D4 (Algorithm 2) with $\gamma > 1$ and $\beta \in (0,1 / K)$ . + +Further, let + +$$ +\begin{array}{l} f _ {\alpha} (j) = l r _ {\max } (j) + j, i ^ {*} = \max \{8, i _ {1}, i _ {2} \}, \\ i _ {1} = \min \{i: (N - 1) \frac {1 0 \gamma i}{\Delta_ {m i n} ^ {2}} < \beta 2 ^ {(i - 1)} \}, \\ a n d i _ {2} = \min \{i: (N - 1 + N K (i - 1)) \leq 2 ^ {i + 1} \}. \\ \end{array} +$$ + +Then the regret for an agent $j \in [N]$ is upper bounded by + +$$ +\begin{array}{l} \mathbb{E}[R_{j}(T)]\leq \underbrace{\sum_{k\notin\mathcal{D}_{j}\cup k_{j}^{*}}\frac{8\gamma}{\Delta_{jk}}\left(\log(T) + \sqrt{\frac{\pi}{\gamma}\log(T)}\right)}_{sub - optimal match} \\ + \underbrace {\sum_ {k \notin \mathcal {D} _ {j}} \sum_ {j ^ {\prime} \in \mathcal {B} _ {j k}: k \notin \mathcal {D} _ {j ^ {\prime}}} \frac {8 \gamma \mu_ {k _ {j} ^ {*}}}{\Delta_ {j ^ {\prime} k} ^ {2}} \left(\log (T) + \sqrt {\frac {\pi}{\gamma} \log (T)}\right)} _ {\text {c o l l i s i o n}} \\ + \underbrace {(K - 1 + | \mathcal {B} _ {j k _ {j} ^ {*}} |) \log_ {2} (T)} _ {\text {c o m m u n i c a t i o n}} \\ + \underbrace {O \left(\frac {N ^ {2} K ^ {2}}{\Delta_ {\operatorname* {m i n}} ^ {2}} + (\beta | \mathcal {H} _ {j} | f _ {\alpha} (J _ {\max } (j)) + f _ {\alpha} (j) - 2) 2 ^ {i ^ {*}}\right)} _ {\text {t r a n s i e n t p h a s e , i n d e p e n d e n t o f T}}. \\ \end{array} +$$ + +Furthermore, if the system satisfies SPC (Definition 2) the $T$ independent term in the above regret bound can be replaced by $O\left(\frac{N^2K^2}{\Delta_{\min}^2} + (\beta |\mathcal{H}_j|J_{\max}(j) + j - 1)2^{i^*}\right)$ . + +We conclude with some remarks about our main result. + +Scaling of regret bounds. Our regret bounds in Theorem 3 are desirable for the following reasons. + +1. Dependence on the arm gaps and horizon. Our regret upper bound is near optimal in the arm gaps and horizon, as it matches with the regret lower bound of $\Omega\left(\frac{\log(T)}{\Delta_{\min}^2}\right)$ in Corollary 6 of (Sankararaman et al., 2021). +2. Polynomial dependence. The constant term associated with the regret bound is polynomial in all the system parameters, including the minimum gap, as + +$$ +2 ^ {i ^ {*}} = O \left(\max \left\{\frac {N}{\beta \Delta_ {\text {m i n}} ^ {2}} \log (\frac {N}{\beta \Delta_ {\text {m i n}} ^ {2}}), N K \log (N K) \right\}\right). +$$ + +Hence, UCB-D4 regret bounds, under uniqueness consistency, has no exponential dependence on system parameters. + +3. Dependence on preference profile. The preference profile influences the regret mainly in three ways. First, each agent deletes the dominated arms $\mathcal{D}_j$ so incurs no long term regret for those arms. The first term in the regret bound scales as $(K - j)$ . Second, for any agent and any non-dominated arms (which are not globally deleted) the blocking agents during exploration creates collision leading to the second term scaling as at most $|\mathcal{H}_j\setminus \mathcal{D}_j|$ . Finally, the constant in the regret bound scales linearly with the order of the agent and all of its blocking agents $(j + J_{\max}(j))$ in SPC. For the uniqueness consistency, the constant depends on both the + +left and right order $(f_{\alpha}(j) = j + lr_{\max}(j))$ of the agent and all of its blocking agents $(f_{\alpha}(j) + f_{\alpha}(J_{\max}(j)))$ + +Local deletion threshold. The local deletion threshold is set as $\beta \times$ phase length $+\Theta (1)$ with $\beta < 1 / K$ . Increasing the threshold leads to higher regret until local deletion vanishes. This happens as more collision is allowed until an arm is deleted. But higher threshold allows for quick detection of the stable matched arm. However, decreasing the threshold leads to a more aggressive deletion leading to lower regret from collision per phase, at a cost of longer detection time for the stable matched arm. In particular, if instead we set local deletion threshold as $\Theta (\mathrm{polylog}(\mathrm{phase~length}))$ then the constant $2^{i^*}$ becomes exponential, i.e. $\exp (N / \Delta_{\mathrm{min}}^2)$ . At one extreme, for $\beta \geq 1 / K$ , the global deletion may stop freezing as the stable matched arm for an agent is not guaranteed to emerge as the most matched arm. In the other extreme, for a threshold of $\Theta (\log (\mathrm{phase~length}))$ with large enough probability the stable matched arm may get locally deleted. In both extremes, the UCB-D4 ceases to work. + +# 5.1. Key Insights into the Proof of Theorem 3 + +The full proof of Theorem 3 is presented in the Appendix E. We first present why UCB-D3 (Sankararaman et al., 2021) that works for the serial dictatorship setting fails under SPC. + +Deadlocks beyond serial dictatorship. Under SPC while running UCB-D3 (Sankararaman et al., 2021) the blocked non-dominated arms cause deadlock where two agents are unable to sample their respective best stable matched arm leading to linear regret. This is best explained by an example. Let us consider the 3 agent $(a, b, \text{and } c)$ , and 3 arm $(1, 2, \text{and } 3)$ system with the preference lists given as + +$$ +\begin{array}{l} \text {a g e n t}: a: 1 > 2 > 3, b: 2 > 1 > 3, c: 3 > 1 > 2, \\ \operatorname {a r m}: 1: a > b > c, 2: a > b > c, 3: a > c > b. \\ \end{array} +$$ + +This system satisfies SPC with the agent optimal stable matching $\{(a,1),(b,2),(c,3)\}$ , but it is not a serial dictatorship. If we run the UCB-D3 algorithm in (Sankararaman et al., 2021) then the agent $a$ matches with arm 1, and agent $b$ and $c$ both delete arm 1 using global deletion. However, without additional coordination, with non-negligible probability, agent $b$ may not match with arm 3 (collision with agent $c$ ), and agent $c$ may not match with arm 2 (collision with agent $b$ ). No further global deletion is guaranteed resulting in a deadlock, hence linear regret (see, Section 6). + +We first focus on the proof for SPC condition before tackling $\alpha$ -condition, as the latter builds on the former. + +Proof Sketch for SPC. There are two main components of the proof, inductive freezing of stable matching pairs, and vanishing of local deletion, both in expected constant time. + +Inductive freezing of stable matching pairs. Local deletion + +of arms with more than $(\beta \times$ phase length) collisions, for $\beta < 1 / K$ , ensures the agent ranked 1 (under SPC) removes all the blocked non-dominated arms, thus it never gets stuck in a deadlock. This gives agent 1 opportunity to detect arm 1 as its most matched arm in expected constant time, as in the presence of arm 1, agent 1 matches with any non-deleted sub-optimal arm $O(\log (\mathrm{phase~length}))$ times with high probability under UCB dynamics. Note that agent 1 never deletes arm 1 (either globally or locally) due to the SPC condition. Agent 2 next deletes dominated arm 1, and for similar reasons as above matches most with arm 2. The proof is completed using an induction over the agents following the SPC order, where in agent $j$ freezing happens in $O(ji^{*})$ phases. + +Constant time vanishing of local deletion. We establish that the local deletion vanishes in expected constant time. Indeed, when all the agents settle to their respective stable matched arms, the sub-optimal play is limited to $O(\log (\mathrm{phase~length}))$ , hence total collision to blocked non-dominated arm is also logarithmic in phase length. This leads to the vanishing of local deletion, which requires $(\beta \times$ phase length) collisions, with an extra $O(\beta |\mathcal{H}_j|J_{\max}(j)2^{i^*})$ regret, where $J_{\max}(j)$ is the maximum blocking agent. + +Stable regime. The terms that grow with $T$ as $O(\log (T))$ are accounted for by keeping count of expected (1) number of sub-optimal matches, (2) number of collisions from blocking agents, and (3) the regret due to communication sub-phases. + +Uniqueness consistency - A tale of two orders. When moving from SPC instances to uniqueness consistency (equivalently $\alpha$ -condition due to Theorem 2) we no longer have the simple inductive structure that we leverage in the proof sketch of SPC. Under $\alpha$ -condition we have two orders instead. The left order states when arm 1 to arm $(j - 1)$ are removed agent $j$ has arm $j$ as the most preferred arm. Whereas, the right order states when agent $A_{1}$ to agent $A_{(k - 1)}$ (recall $\{A_1,\ldots ,A_N\}$ is a separate permutation of the agents) are removed arm $a_{k}$ prefers agent $A_{k}$ . Global deletion here must follow left order. However, unlike SPC the set of blocking agents for agent 1 and arm 1 (i.e. $\mathcal{B}_{11}$ ) is nonempty. Thus, agent 1 cannot get matched with arm 1 majority of time unless the agents in $\mathcal{B}_{11}$ stop playing arm 1. We next show how this is resolved. + +Proof Sketch of $\alpha$ -condition. We show due to local deletion an inductive warmup of stable matching pairs precedes the two phases mentioned in the proof sketch of SPC. + +Inductive warmup of stable matching pairs. We begin with an observation that holds for every stable matching: for any two stable matching pair $(j,k)$ , $(j',k')$ , the arm $k$ is either sub-optimal (has mean reward lesser than $k'$ ) for agent $j'$ , + +or arm $k$ prefers agent $j$ over agent $j'$ . Hence, in our system, for any $2 \leq j \leq N$ , either (a) arm $a_j$ (stable matched arm for agent $A_j$ ) is suboptimal for agent $A_1$ , or (b) arm $a_j$ prefers $A_j$ over $A_1$ . In case (b) arm $A_1$ never causes collision in $a_j$ for agent $A_j$ . Now suppose case (a) holds. Due to $\alpha$ -condition, the agent $A_1$ is the most preferred for arm $a_1$ . Therefore, arm $a_1$ is always available to agent $A_1$ , and $a_1$ has higher mean than $a_j$ . This implies the UCB algorithm plays arm $a_j$ only $O(\log (\text{phase length}))$ times with high probability in any phase. Once this happens, arm $a_2$ is almost always available to $A_2$ , and the induction sets in. This is used to prove $A_j$ is warmed up in $O(ji^*)$ phases, or agent $j$ is warmed up in $O(lr(j)i^*)$ phases. Once agent 1 is warmed up the inductive freezing starts as it matches with arm 1. The rest closely follows the proof of SPC. + +# 6. Numerical Simulations + +In this section, we present our numerical simulations with 5 agents and 6 arms. Additional results with larger instances are deferred to the Appendix F. + +Baselines. We use two baselines with their own feedback. 1. Centralized UCB (UCB-C) is proposed in (Liu et al., 2020a) for the centralized feedback setting, where each agent in every round submits its preference order (based on UCB indices) to a centralized agent who assigns the agent optimal matching under this preference, and the rewards are observed locally. +2. Collision Avoidance UCB (CA-UCB) is proposed in (Liu et al., 2020b) for the decentralized with partial information setting where at each round all agents observe the player matched to each arm, but rewards are observed locally. + +The centralized setting is the most relaxed where no collision happens, followed by the partial decentralized setting where each round the matching of arms can be learned without any collision. Both are relaxed compared to our decentralized with no information setting where any global information can be obtained only through collisions. + +Results. We generate random instances to compare the performance of UCB-C, CA-UCB and UCB-D4 in their respective settings. Since (Liu et al., 2020b) does not mention how to set their hyper-parameter $\lambda$ , we report the best result by running a grid search over $\lambda$ . For UCB-D4, we use $\beta = 1/2K$ and $\gamma = 2$ . We simulate all the algorithms on the same sample paths, for a total 50 sample paths and report mean, $75\%$ and $25\%$ agent-optimal regret. + +Figure 1 shows that in a general instance phased ETC outperforms CA-UCB even with a restricted feedback, whereas, as expected, UCB-C outperforms phased ETC. Figure 2 shows that when uniqueness condition holds UCB-D4, despite the restricted feedback, outperforms CA-UCB, while it is comparable to the centralized UCB-C. + +Linear Regret of UCB-D3 in SPC. Figure 3 shows that even when the SPC condition holds, UCB-D3 may result in linear regret, emphasizing the importance of UCB-D4. + +![](images/fd4e1c173f825b01e7848873445fe53ca2aba186e50d549dc1749741a4ee6f11.jpg) +Figure 1. A general instance with $N = 5$ , and $K = 6$ . Regret: UCB-C (blue) < Phased-ETC (orange) < CA-UCB (green). + +![](images/fa435f568f68d14328494d91e2ab9e57b6fe5c003570ac034dccd751861a2658.jpg) +Figure 2. An $\alpha$ -condition instance with $N = 5$ , and $K = 6$ . Regret: UCB-C (blue) < UCB-D4 (green) < CA-UCB (orange). + +![](images/47c166cc56f93c8eca426171d69425ef4aa153524b67c9582fc36bdfd7652b8d.jpg) +Figure 3. Linear regret of UCB-D3 for an SPC instance. + +# References + +Aridor, G., Mansour, Y., Slivkins, A., and Wu, Z. S. Competing bandits: The perils of exploration under competition. arXiv preprint arXiv:2007.10144, 2020. +Ashlagi, I., Krishnaswamy, A. K., Makhijani, R., Saban, D., and Shiragur, K. Assortment planning for two-sided sequential matching markets. arXiv preprint arXiv:1907.04485, 2019. +Avner, O. and Mannor, S. Multi-user lax communications: a multi-armed bandit approach. In IEEE INFOCOM 2016-The 35th Annual IEEE International Conference on Computer Communications, pp. 1-9. IEEE, 2016. +Bistritz, I. and Leshem, A. Game of thrones: Fully distributed learning for multiplayer bandits. Mathematics of Operations Research, 2020. +Boursier, E. and Perchet, V. SIC-MMAB: synchronisation involves communication in multiplayer multi-armed bandits. In Wallach, H. M., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E. B., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 12048-12057, 2019. URL https://proceedings.neurips.cc/paper/2019/ hash/c4127b9194fe8562c64dc0f5bf2c93bc Abstract.html. +Boursier, E. and Perchet, V. Selfish robustness and equilibria in multi-player bandits. In Abernethy, J. D. and Agarwal, S. (eds.), Conference on Learning Theory, COLT 2020, 9-12 July 2020, Virtual Event [Graz, Austria], volume 125 of Proceedings of Machine Learning Research, pp. 530-581. PMLR, 2020. URL http://proceedings.mlr.press/v125/boursier20a.html. +Bränzei, S. and Peres, Y. Multiplayer bandit learning, from competition to cooperation. arXiv preprint arXiv:1908.01135, 2019. +Bubeck, S. and Cesa-Bianchi, N. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations & Trends in Machine Learning, 2012. +Buccapatnam, S., Tan, J., and Zhang, L. Information sharing in distributed stochastic bandits. In 2015 IEEE Conference on Computer Communications (INFOCOM), pp. 2605-2613. IEEE, 2015. +Chawla, R., Sankararaman, A., Ganesh, A., and Shakkottai, S. The gossiping insert-eliminate algorithm for multiagent bandits. In Chiappa, S. and Calandra, R. (eds.), The + +23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy], volume 108 of Proceedings of Machine Learning Research, pp. 3471-3481. PMLR, 2020. URL http://proceedings.mlr.press/v108/chawla20a.html. +Dai, X. and Jordan, M. I. Learning strategies in decentralized matching markets under uncertain preferences. arXiv preprint arXiv:2011.00159, 2020. +Darak, S. J. and Hanawal, M. K. Multi-player multi-armed bandits for stable allocation in heterogeneous ad-hoc networks. IEEE Journal on Selected Areas in Communications, 37(10):2350-2363, 2019. +Dubey, A. and Pentland, A. S. Cooperative multi-agent bandits with heavy tails. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 2730-2739. PMLR, 2020. URL http://proceedings.mlr.press/v119/dubey20a.html. +Eeckhout, J. On the uniqueness of stable marriage matchings. Economics Letters, 69(1):1-8, 2000. +Gale, D. and Shapley, L. S. College admissions and the stability of marriage. The American Mathematical Monthly, 69(1):9-15, 1962. +Hillel, E., Karnin, Z. S., Koren, T., Lempel, R., and Somekh, O. Distributed exploration in multi-armed bandits. In Burges, C. J. C., Bottou, L., Ghahramani, Z., and Weinberger, K. Q. (eds.), Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States, pp. 854-862, 2013. URL https://proceedings.neurips.cc/paper/2013/hash/598b3e71ec378bd83e0a727608b5db01 Abstract.html. +Johari, R., Kamble, V., and Kanoria, Y. Matching while learning. Operations Research, 2021. +Kalathil, D., Nayyar, N., and Jain, R. Decentralized learning for multiplayer multiarmed bandits. IEEE Transactions on Information Theory, 60(4):2331-2345, 2014. +Karpov, A. A necessary and sufficient condition for uniqueness consistency in the stable marriage matching problem. *Economics Letters*, 178:63–65, 2019. +Kolla, R. K., Jagannathan, K., and Gopalan, A. Collaborative learning of stochastic bandits over a social network. IEEE/ACM Transactions on Networking, 26(4): 1782-1795, 2018. + +Landgren, P., Srivastava, V., and Leonard, N. E. Distributed cooperative decision making in multi-agent multi-armed bandits. Automatica, 125:109445, 2021. +Larrnaaga, M., Ayesta, U., and Verloop, I. M. Dynamic control of birth-and-death restless bandits: Application to resource-allocation problems. IEEE/ACM Transactions on Networking, 24(6):3812-3825, 2016. +Lattimore, T. and Szepesvári, C. Bandit algorithms. Cambridge University Press, 2020. +Liu, L. T., Mania, H., and Jordan, M. I. Competing bandits in matching markets. In Chiappa, S. and Calandra, R. (eds.), The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy], volume 108 of Proceedings of Machine Learning Research, pp. 1618-1628. PMLR, 2020a. URL http://proceedings.mlr.press/v108/liu20c.html. +Liu, L. T., Ruan, F., Mania, H., and Jordan, M. I. Bandit learning in decentralized matching markets. arXiv preprint arXiv:2012.07348, 2020b. +Mehrabian, A., Boursier, E., Kaufmann, E., and Perchet, V. A practical algorithm for multiplayer bandits when arm means vary among players. In Chiappa, S. and Calandra, R. (eds.), The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy], volume 108 of Proceedings of Machine Learning Research, pp. 1211-1221. PMLR, 2020. URL http://proceedings.mlr.press/v108/mehrabian20a.html. +Rosenski, J., Shamir, O., and Szlak, L. Multi-player bandits - a musical chairs approach. In Balcan, M. and Weinberger, K. Q. (eds.), Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 155-163. JMLR.org, 2016. URL http://proceedings.mlr.press/v48/rosenski16.html. +Sankararaman, A., Ganesh, A., and Shakkottai, S. Social learning in multi agent multi armed bandits. Proceedings of the ACM on Measurement and Analysis of Computing Systems, 3(3):1-35, 2019. +Sankararaman, A., Basu, S., and Sankararaman, K. A. Dominate or delete: Decentralized competing bandits in serial dictatorship. In Banerjee, A. and Fukumizu, K. (eds.), The 24th International Conference on Artificial Intelligence and Statistics, AISTATS 2021, April 13-15, 2021, Virtual Event, volume 130 of Proceedings + +of Machine Learning Research, pp. 1252-1260. PMLR, 2021. URL http://proceedings.mlr.press/v130/sankararaman21a.html. +Slivkins, A. Introduction to multi-armed bandits. Foundations and Trends® in Machine Learning, 12(1-2):1-286, 2019. \ No newline at end of file diff --git a/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/images.zip b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8936aca5275c2c60d547b9e0c472f83b0cc86f1b --- /dev/null +++ b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6cd1dbf5053447794a10934d78a67e97ca8445a544bde86c0d1ab64f9f4280e +size 252746 diff --git a/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/layout.json b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ee626c494b4b27050fac38365ace7892c6d72756 --- /dev/null +++ b/beyondlog2tregretfordecentralizedbanditsinmatchingmarkets/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8236acd95bc029e22830f620c136cbc14b638334c3737ec1cbd0105f4979f849 +size 614685 diff --git a/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_content_list.json b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e5c33f8323c0393ed275cdf75fb89bbe85cf4833 --- /dev/null +++ b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef29b568c6bf2314147a7a0b4f0c581e2c374bc3bf4968c2ce75c92ee7ee5ad0 +size 91670 diff --git a/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_model.json b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cbe040ad1651a083b62d8accbc1132e0d4f18a02 --- /dev/null +++ b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d803edc82c03d91e88037265441525ee8bc20316ceef5d5fd75a42697a0ba8c +size 110263 diff --git a/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_origin.pdf b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1af166bdac4e2993c6789057df5c194e847e72f9 --- /dev/null +++ b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/961a2b5a-698c-4ea0-b8db-e5e4c425b598_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a0d17e279f6ec3cf481f63e94442879c6664468643d2d63521176ba3d655387 +size 2900674 diff --git a/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/full.md b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4690a426fe50f1962b1cf25da17483f01d89f7e5 --- /dev/null +++ b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/full.md @@ -0,0 +1,397 @@ +# Beyond the Pareto Efficient Frontier: Constraint Active Search for Multiobjective Experimental Design + +Gustavo Malkomes1 Bolong Cheng1 Eric Hans Lee1 Michael McCourt1 + +# Abstract + +Many problems in engineering design and simulation require balancing competing objectives under the presence of uncertainty. Sample-efficient multiobjective optimization methods focus on the objective function values in metric space and ignore the sampling behavior of the design configurations in parameter space. Consequently, they may provide little actionable insight on how to choose designs in the presence of metric uncertainty or limited precision when implementing a chosen design. We propose a new formulation that accounts for the importance of the parameter space and is thus more suitable for multiobjective design problems; instead of searching for the Paretoefficient frontier, we solicit the desired minimum performance thresholds on all objectives to define regions of satisfaction. We introduce an active search algorithm called Expected Coverage Improvement (ECI) to efficiently discover the region of satisfaction and simultaneously sample diverse acceptable configurations. We demonstrate our algorithm on several design and simulation domains: mechanical design, additive manufacturing, medical monitoring, and plasma physics. + +# 1. Introduction + +Accelerated design and optimization via machine learning is receiving increasing interest in multiple science and engineering disciplines, such as materials design, drug discovery, and chemical engineering (Forrester et al., 2008; Negoescu et al., 2011; Molesky et al., 2018). Using numerical simulation to study the impact of design decisions prior to manufacturing has become a common strategy to reduce the number of fabrications, thus reducing the substantial cost of development cycles. + +In recent years, active learning has gained popularity in scientific communities. These adaptive methods more efficiently identify promising candidates compared to brute-force or evolutionary algorithms (Song et al., 2018; Attia et al., 2020; Haghanifar et al., 2020; Duris et al., 2020). Bayesian optimization (BO) is arguably the most prominent example of active learning, where the goal is to seek the optimizer $\arg \max_{\mathbf{x}} f(\mathbf{x})$ of an expensive-to-evaluate black-box objective $f$ . + +However, in most real world applications, multiple competing objectives need to be investigated (Koziel et al., 2014; Singh et al., 2016). Optimality of multiobjective problems is usually defined by the concept of Pareto efficiency, where no individual objective can be improved without loss in at least one other objective. Most work on optimizing multiple objectives focuses on searching for the Pareto efficient frontier (and the corresponding parameters). In general, for an $m$ -objective problem, the (nearly) Pareto efficient solutions are assumed to be a dense set of points on an $(m - 1)$ -dimensional manifold (Konakovic-Lukovic et al., 2020). Unfortunately, using the Pareto frontier as the measurement of success is limiting in engineering and design applications; candidates near the Pareto frontier, unaccounted for in most optimization literature, are still of scientific interest in the real world (del Rosario et al., 2020). + +In practice, design objectives can also be formulated as inequality constraints, where the decision makers seek to find design choices that satisfy known performance thresholds on each objective. This formulation is related to the topic of level set estimation (LSE) in the single objective setting. Its goal is to determine the decision boundary of parameter space that separates it above and below the threshold on the objective (Gotovos et al., 2013). However, the notion of level set does not naturally extend to the multiobjective settings; a naive approach of identifying the level set for each objective and taking the intersection is not computationally efficient. In addition, most LSE algorithms focus on searching for the decision boundary; in the multiobjective setting, this behavior cannot reveal the tradeoff among objectives, since there are not enough samples within the region of interest. + +Figure 1 illustrates the limitations of multiobjective BO and + +![](images/6ed65d2199d9b00b77e4bde5742f5840e89e5eb59bf9da9b2b4f9eb6086f5d11.jpg) + +![](images/7efc5071668330baa8484020418efc1703b038d67f5b5c7c7e4c5731b840ec44.jpg) + +![](images/fcc2781d025bf7cc41ac513fc55bd05614849faf74ebeda921fd829cd52acddf.jpg) + +![](images/8e4a8c1589dd850fe0b1e0cc3be2ff59dddf9d3b149223650fb14e1d153c799a.jpg) +Figure 1. Comparison of BO, LSE, constraint active search, and random search behaviors on the same multiobjective problem. The top row shows the observed samples in the parameter space; the bottom row, in the metric space. The shaded region represents the satisfactory regions of interest, where both objectives exceed the known thresholds (labeled with dashed black lines in the metric space). + +![](images/146070f434493296c8784e9cb4af0eb887bc2fd87c249e9676f81ed4b1fa91b4.jpg) + +![](images/85023c14eb6fc35637466314b59f24654f5a7a73d098554cb9f32199f1dd7206.jpg) + +LSE respectively, and highlights constraint active search as a new perspective on multiobjective problems. BO focuses on searching for the Pareto efficient parameters. LSE focuses on searching for the boundary of the region satisfying the thresholds. Constraint active search attempts to sample from that region of interest. + +Our paper makes the following contributions: + +- We propose an alternative formulation for the multi-objective design problem as an active search problem. In this setting, the objectives are treated as constraints with known threshold values; the goal is to find diverse samples that satisfy all the thresholds. We call this formulation constraint active search (CAS). +- We develop an algorithm called expected coverage improvement (ECI) for constraint active search that preserves the sample efficiency of active search whilst also diversely sampling from the regions of interest. We provide theoretical analysis on the sample diversity of ECI; specifically, it guarantees a constant approximation ratio to the optimal sample diversity. +- We compare ECI to various baselines on a suite of synthetic multiobjective design benchmarks as well as real-world multiobjective design and simulation applications in materials science, medical monitoring, and plasma physics. + +# 2. Related Work + +# 2.1. Multiobjective Bayesian Optimization + +Bayesian optimization (BO) is a popular method for optimizing expensive, black-box objective functions. BO consists of two components: a probabilistic model, to model the objective function $f$ , and an acquisition function, to determine which parameters $x$ to sample next. In this section, we focus on reviewing the literature of BO in the multiobjective setting. We refer the readers to Frazier (2018) for a comprehensive review of BO in the single objective setting. + +There are several strategies at adapting BO to multiobjective optimization. The simplest approach is linear scalarization, where single objective BO strategies optimize a linear combination of the objectives. Knowles (2006) first proposes using a random scalarization of the objective functions to search for the entire frontier. This method is further improved in Paria et al. (2020), which models each individual objective with a separate Gaussian process (GP). + +A related approach involves reformulating the problem as a constrained optimization problem, commonly known as the $\varepsilon$ -constraint method (Haghanifar et al., 2020). In particular, this formulation leverages prior works from constrained Bayesian optimization literature (Gelbart, 2015; Gardner et al., 2014). In constrained BO, a probabilistic model is formed for each constraint and used as a multiplicative penalty term in the acquisition function (Letham et al., 2019). Recent works on constrained BO borrow ideas + +from the mathematical optimization community such as the trust region (Eriksson & Poloczek, 2021) and Alternating Directions Methods of Multiplier (Ariafar et al., 2019). + +A separate line of research in multiobjective BO improves the hypervolume of the Pareto efficient frontier directly (Emmerich et al., 2011; Konakovic-Lukovic et al., 2020; Daulton et al., 2020). Belakaria et al. (2019) adapts the entropy search acquisition function for the multiobjective setting, by maximizing the entropy of the Pareto frontier. Belakaria et al. (2020) and Fernandez-Sanchez et al. (2021) build upon this work to incorporate additional black-box inequality constraints. Almost all multiobjective BO literature uses the hypervolume of the Pareto frontier as their performance criterion. While hypervolume provides a single numerical value for the ease of comparison, using it as the sole criterion of success misses the goal of multi-objective optimization — understanding tradeoffs between parameters and objectives. + +# 2.2. Level Set Estimation + +The goal of level set estimation is to determine the regions where the objective function lies above or below a known threshold level. Bryan et al. (2005) first uses a GP-based active learning approach to tackle this problem through the straddle heuristic, defined as + +$$ +\operatorname {S T R A D D L E} (\mathbf {x}) = 1. 9 6 \sqrt {v (\mathbf {x})} - | f (\mathbf {x}) - \tau |, +$$ + +where $\tau$ is the threshold of the level set and $v$ is the model uncertainty. Gotovos et al. (2013) generalizes the straddle heuristic and provides theoretical guarantees on the classification quality. Zanette et al. (2019) maximizes the expected increase in the volume of the predicted level set. Iwazaki et al. (2020) considers the LSE problem with input uncertainty, where the input parameter values are subject to perturbation from a known Normal distribution. This work is related to research in safe BO (Sui et al., 2015; 2018), where only configurations exceeding the threshold with high probability are sampled. + +Almost all LSE methods focus on identifying the decision boundary. To our best knowledge, Wang et al. (2018) is the closest example of learning and diversely sampling from a region of interest (in the single objective setting). It divides the sampling procedure into two disjoint algorithms: one determines the level set and the other samples diversely from the interior of the learned level set. + +The notion of a level set does not naturally extend beyond more than one objective. Bryan & Schneider (2008) only considers the multiobjective problem in a composite setting, where a single threshold is used for a linear combination of the objective functions. One naive and inefficient approach to extend existing LSE algorithms to multiobjective problems is to estimate the level set of each objective separately + +and then intersect each region of interest. + +# 2.3. Active Search + +Our proposed work is also related to the topic of active search (Garnett et al., 2012). Active search can be seen as a special case of Bayesian optimization, where one has binary observations and cumulative reward. The goal of active search is to sequentially discover members of a rare, desired class. Inspecting any element is assumed to be expensive, representing, for instance, the cost of performing a real world laboratory experiment. + +Garnett et al. (2012) explores this problem using Bayesian decision theory, introduces a natural utility function for active search, and derives the optimal policy for this framework. In general, only myopic (one-step) approximations to the optimal policy are computationally tractable. More recently, Jiang et al. (2017) proposes an nonmyopic and efficient approximation to the optimal policy, which is later extended to the batch setting in Jiang et al. (2018). Active search, however, is not designed to solve multiobjective continuous problems—a problem that we address next. + +# 3. Constraint Active Search + +Scientists, engineers, and decision makers seldom rely on single-point observations to make final design decisions. Instead, they seek a diverse set of design configurations to enrich their understanding of each objective function's impact and its respective tradeoffs. As Figure 1 illustrates, neither BO nor LSE is well-suited to address these experimental design concerns. The former clusters around optima, and the latter clusters around the level set boundary. + +We propose an alternative formulation to the multiobjective design problem better suited to gather a diverse spectrum of design configurations. The goal of this formulation is to efficiently cover an unknown, possibly disconnected, set $S$ defined by the objective thresholds $\tau$ in a sequential fashion. We call this problem constraint active search. In Section 5, we illustrate how CAS may enable a practitioner to make better decisions than those made by exclusively identifying the Pareto frontier on an additive manufacturing problem. + +This concept is related to del Rosario et al. (2020) which advocates that the Pareto frontier itself is insufficient for scientific and engineering settings. That work introduces the notion of Pareto shells, the set of near Pareto optimal solutions, as the desired outcome of multiobjective optimization. We propose that, when thresholds $\tau$ are available, studying the full region of constraint satisfaction1 is preferable. + +![](images/4566d4519126b3b101cb9ff21d3cfd551761947d900d3613bbadf02266cd8578.jpg) +Figure 2. An illustration of our utility function when constraint active search is run on the 2D sinusoids problem in (Bryan et al., 2005). Each of the four subfigures above plots a single realization of the underlying stochastic model and outlines the decision boundary of the satisfactory region in magenta. The observations within the boundary are marked with blue crosses, and a dotted blue ball of radius $r = 0.2$ is drawn around each to indicate coverage. A ball is also drawn around the candidate point, itself marked with a black star. The improvement of the utility is the volume of the blue region, and expected coverage improvement is the average value of all realizations. + +![](images/efe100f3d98d91e6d273d127ff2d995a679c69d0c90153af9292e1f7d965ec47.jpg) + +# 3.1. Problem Statement + +Suppose we want to search for design configurations in a compact search space $\mathcal{X}$ . We may judge the quality of a design $\mathbf{x} \in \mathcal{X}$ by evaluating $m$ expensive black-box objective functions $f_{1}, f_{2}, \ldots, f_{m}$ , each mapping $\mathcal{X}$ to $\mathbb{R}$ . We seek designs $\mathbf{x}$ that yield acceptable performance, defined by threshold values $\boldsymbol{\tau} = [\tau_{1}, \tau_{2}, \dots, \tau_{m}]^{\top}$ . Specifically, we wish to sequentially select configurations from the set: + +$$ +\mathcal {S} = \{\mathbf {x} \mid f (\mathbf {x}) \succeq \tau \}, +$$ + +where $f(\mathbf{x})\succeq \pmb{\tau}:= f_{i}(\mathbf{x})\geq \tau_{i},i = 1,\ldots ,m.$ At iteration $t$ we assume we have evaluated $t$ design configurations $\mathbf{X}_t = \{\mathbf{x}_j\}_{j = 1}^t$ and their respective outputs $\mathbf{Y}_t = \{\mathbf{y}_j\}_{j = 1}^t$ where $\mathbf{y}_j = [y_{j_1},y_{j_2},\dots,y_{j_m}]$ is the potentially noisy observation of the objective functions $f_{1},f_{2},\ldots f_{m}$ evaluated at $\mathbf{x}_j$ . These observations form the dataset $\mathcal{D}_t = (\mathbf{X}_t,\mathbf{Y}_t)$ + +We assume we have $m$ independent probabilistic models that capture our prior beliefs about observations $y_{i} = f_{i}(\mathbf{x}_{i}) + \varepsilon_{i}$ for $i = 1,2,\ldots ,m$ , as a probability distribution over $p(\mathbf{y})$ , where $\varepsilon_{i}$ is additive Gaussian noise. We also assume $p(\mathbf{y})$ allows posterior updates when $\mathcal{D}$ is observed, i.e., $p(\mathbf{y} \mid \mathcal{D})$ . Let $Z$ be an indicator variable that tells us if a point $\mathbf{x}$ will satisfy the thresholds, $Z(\mathbf{x}) = \mathbb{1}\left[\mathbf{y}(\mathbf{x}) \succeq \boldsymbol{\tau}\right]$ . Our model of $\mathbf{y}$ allows us to compute the probability of any point $\mathbf{x}$ belonging to the satisfactory region $\mathcal{S}$ after observing $\mathcal{D}_t$ , which we denote by $p(Z(\mathbf{x}) = 1 \mid \mathcal{D}_t)$ . We delay discussing the statistical model's details until Section 4, as they are immaterial to decision-making. + +# 3.2. Expected Coverage Improvement + +Our approach to constraint active search considers an additional resolution parameter $r$ ; in real-world problems one can often define $r$ in terms of the robustness of the design to perturbations. Typically, most experimental design problems possess a sense of known resolution, such as simulation + +accuracy or manufacturing precision/tolerance. This presumes that any design configuration within distance $r$ of another does not convey extra information about $S$ . + +Definition 3.1 (Coverage neighborhood). The coverage neighborhood of any $\mathbf{x}$ is defined as + +$$ +\mathbb {N} _ {r} (\mathbf {x}) = \left\{\mathbf {x} ^ {\prime}: d (\mathbf {x}, \mathbf {x} ^ {\prime}) < r \right\}, +$$ + +for an a priori fixed $r\in \mathbb{R}^+$ and an appropriate distance function $d:\mathcal{X}\times \mathcal{X}\mapsto \mathbb{R}^{+}$ . The coverage neighborhood of a set of points $\mathbf{X}$ is defined as + +$$ +\mathbb {N} _ {r} (\mathbf {X}) = \bigcup_ {\mathbf {x} \in \mathbf {X}} \mathbb {N} _ {r} (\mathbf {x}). +$$ + +For Euclidean distance, $\mathbb{N}_r(\mathbf{x})$ is simply a ball of radius $r$ . + +Constraint active search prioritizes datasets $\mathcal{D}$ that cover as much volume of the satisfactory region $S$ as possible. We express this desire with the following utility function: + +$$ +u (\mathcal {D}) = \operatorname {V o l} \left(\mathbb {N} _ {r} (\mathbf {X}) \cap \mathcal {S}\right). +$$ + +Intuitively, $u(\mathcal{D})$ measures the total volume of $S$ that is covered by neighborhood $\mathbb{N}_r(\mathbf{x})$ for all $\mathbf{x} \in \mathbf{X}$ . At iteration $t$ , the expected improvement of this utility function for sampling a candidate configuration $^2 \mathbf{x}$ is: + +$$ +\begin{array}{l} \alpha (\mathbf {x} \mid \mathcal {D} _ {t}) = \mathbb {E} _ {\mathbf {y}} \left[ u \left(\mathcal {D} _ {t} \cup (\mathbf {x}, \mathbf {y})\right) - u (\mathcal {D} _ {t}) \right] \\ = \mathbb {E} _ {Z} \left[ \operatorname {V o l} \left(\left\{\mathbb {N} _ {r} (\mathbf {x}) \cap \mathcal {S} _ {Z} \right\} \backslash \mathbb {N} _ {r} \left(\mathbf {X} _ {\mathbf {t}}\right)\right) \right]. \tag {1} \\ \end{array} +$$ + +We can also refer to (1) as an acquisition function. At iteration $t$ , our policy selects the location $\mathbf{x}^*$ that maximizes the acquisition function, i.e., $\mathbf{x}^* = \arg \max_{\mathbf{x} \in \mathcal{X}} \alpha(\mathbf{x} \mid \mathcal{D}_t)$ . We visualize the intuition behind our policy for different + +realizations of $Z$ in Figure 2. Our acquisition function considers the volume of $S_Z$ that a new candidate location is expected to cover under our current belief about $Z$ . + +A common practice in the LSE and active search literature is to work on discrete search spaces: $\mathcal{X}$ could be discretized by sampling a pool of $n$ points. In this discretized setting, (1) simplifies to + +$$ +\begin{array}{l} \alpha (\mathbf {x} \mid \mathcal {D} _ {t}) = \mathbb {E} _ {Z} \left[ \sum_ {\mathbf {x} ^ {\prime} \in \mathbb {N} (\mathbf {x}) \backslash \mathbb {N} _ {r} (\mathbf {X})} Z (\mathbf {x} ^ {\prime}) \right] \\ = \sum_ {\mathbf {x} ^ {\prime} \in \mathbb {N} (\mathbf {x}) \backslash \mathbb {N} _ {r} (\mathbf {X})} \mathbb {E} _ {Z} \left[ Z \left(\mathbf {x} ^ {\prime}\right) \right] \\ = \sum_ {\mathbf {x} ^ {\prime} \in \mathbb {N} (\mathbf {x}) \backslash \mathbb {N} _ {r} (\mathbf {X})} p (Z (\mathbf {x} ^ {\prime}) = 1 \mid \mathcal {D} _ {t}). \quad (2) \\ \end{array} +$$ + +In practice, the argmax of $\alpha (\mathbf{x}\mid \mathcal{D}_t)$ is often nonunique, especially at the start of search. This reflects the intuition that when only a few observations sparsely cover $S$ , multiple—and possibly many—candidates will contribute equally to the expected coverage. Crucially, if this occurs, we break ties among the multiple optimum points by selecting the one furthest from all observations in $\mathbf{X}_t$ , which encourages selecting a diverse set of points. We call this policy expected coverage improvement (ECI). + +# 3.3. Theoretical Analysis of ECI + +We present three theoretical results for ECI (proved in the supplement). All assume that $S$ is fixed a priori — that $S$ does not change as iteration proceeds. + +Theorem 1. If we have a budget of one iteration left, then ECI is one-step Bayes-optimal among all feasible policies. + +This result is not particularly surprising. The next pair of less trivial theorems concern the convergence of CAS using ECI. Because CAS seeks to sample a diverse set of points, we measure this diversity with fill distance. Fill distance is the standard measure of point diversity in the quasi-Monte Carlo (Joy et al., 1996), experimental design (Pronzato & Müller, 2012), and meshfree approximation (Fasshauer & McCourt, 2015) communities. The convergence of the fill distance of ECI thus describes the limiting behavior of its sample diversity. + +Given a set of sample points $\mathbf{X}$ , the fill distance is formally defined as the following: + +$$ +\operatorname {F I L L} (\mathbf {X}, \mathcal {S}) = \sup _ {\mathbf {x} \in \mathcal {S}} \min _ {\mathbf {x} _ {j} \in \mathbf {X}} d (\mathbf {x} _ {j}, \mathbf {x}). \tag {3} +$$ + +In Euclidean space, $\mathrm{FILL}(\mathbf{X},\mathcal{S})$ is the radius of the largest empty ball one can fit in $\mathcal{S}$ , and measures the spacing of $\mathbf{X}$ in $\mathcal{S}$ . The smaller a set's fill, the better distributed it is within $\mathcal{S}$ . Minimal fill is defined in the following sense: + +$$ +\rho = \min _ {\mathbf {X} \in \mathcal {X} ^ {n}} \operatorname {F I L L} (\mathbf {X}, \mathcal {S}). +$$ + +Low-discrepancy sequences and Latin hypercubes achieve low fill in simple domains. However, computing the minimal fill is generically NP-hard (Pronzato & Müller, 2012). + +Having defined fill distance, we can now frame convergence in terms of the limiting behavior of $\mathrm{FILL}(\mathbf{X},\mathcal{S})$ as $n$ approaches infinity. This is formalized as follows. + +Theorem 2. If $S$ is dense, ECI produces a dense sequence of evaluation points in $S$ . Equivalently, the limit as $n$ approaches infinity of $\mathrm{FILL}(\mathbf{X}, S)$ is zero. + +A more interesting remark is that we are able to bound the rate at which ECI fills the set $S$ . We can guarantee that ECI produces a fill bounded above by $4\rho$ , and that for a sufficiently large iteration budget, ECI produces a fill that is no more than $2\rho$ . + +Theorem 3. For a fixed and known $S$ , let $\rho = \min_{\mathbf{X}} \mathrm{FILL}(\mathbf{X}, S)$ . For any $n$ , ECI produces a fill bounded above by $4\rho$ . Furthermore, there exists a finite $\mathbf{n}^*$ for which ECI produces a 2-approximation ratio of $\rho$ for all $n \geq \mathbf{n}^*$ . + +# 4. Experiments + +In our experiments, we build an independent Gaussian process (GP) to model each objective (Rasmussen & Williams, 2005). In particular, for a GP model and a single objective, + +$$ +p (Z (\mathbf {x}) = 1 \mid \mathcal {D} _ {t}) = \int_ {\tau} ^ {\infty} \phi (y \mid \mu (\mathbf {x}), v (\mathbf {x})) d y, \tag {4} +$$ + +where $\phi$ is the Normal PDF, and $\mu (\mathbf{x})$ and $v(\mathbf{x})$ are the GP's posterior mean and variance, respectively, evaluated at $\mathbf{x}$ . For $m$ objectives modeled by $m$ independent GPs, $p(Z(\mathbf{x}) = 1\mid \mathcal{D}_t)$ is the product of probabilities associated with each model. Our GPs use a zero mean function and a $C^4$ Matérn covariance kernel with length scales fixed $a$ priori (more information is provided in the supplement). + +# 4.1. Baseline Methodologies + +In addition to random search (RND), we compare our algorithm to several (modified) baseline algorithms aforementioned in Section 2: $\varepsilon$ -constraint BO (Haghanifar et al., 2020), STRADDLE (Bryan et al., 2005), and one-step active search (Garnett et al., 2012). We extend STRADDLE to the multiobjective setting by alternating the objective functions at each iteration. For one-step active search, we maximize the point with highest probability $p(Z(\mathbf{x}) = 1 \mid \mathcal{D}_t)$ at each iteration, which we call ONE-S. In addition, we develop two information theoretic baselines: + +Mutual information (EZ): We consider the mutual information between $\mathbf{y}$ and $Z$ . Assuming noiseless observations $f_{i}(\mathbf{x}) = \mathbf{y}_{i}, \forall i$ , this simplifies to the entropy of $Z$ : + +$$ +\operatorname {M I} (\mathbf {y}; Z) = H (\mathbf {y}) - \mathbb {E} _ {Z} [ H (\mathbf {y} \mid Z) ] = H (Z), +$$ + +Figure 3. Median metric values across 20 repetitions for the additive manufacturing application. We plot the fill distance, number of positive samples, hypervolume, and coverage recall respectively. Shaded region corresponds to values between lower and upper quartiles. +![](images/f967955cf37be0e91984a8a53146387945f4f4f3df0949479278a06341050642.jpg) +ECI BO EZ EISR STRADDLE ONE-S RND + +![](images/1ff814dd5a9f2a181289e7b1df3fcda57f38542c66cf2690200a5845c81918de.jpg) + +![](images/6227e21093d87455d869fce494bc357f0fb29a3436300886156b3b78c1085b4e.jpg) + +![](images/264ad642ee4621595643521bbba81baa4ad397f2c3246f2c67229e2dca46d61f.jpg) + +where $H(\cdot)$ is the entropy of a random variable. This would be the one-step optimal strategy that recovers the most information about the boundaries of $S$ . + +Entropy inside $S$ (EISR): We consider the utility: + +$$ +u _ {\mathrm {E I S R}} (\mathbf {x}) = \left\{ \begin{array}{l l} 0 & Z = 0, \\ H (f \mid \mathbf {x}) & Z = 1. \end{array} \right. +$$ + +$u_{\mathrm{EISR}}$ rewards sampling configurations that are inside $S$ and have high entropy. The corresponding acquisition function can be written as + +$$ +\alpha_ {\mathrm {E I S R}} = \mathbb {E} _ {Z} \left[ u _ {\mathrm {E I S R}} (\mathbf {x}) \right] = p (Z (\mathbf {x}) = 1) H (\mathbf {y}). +$$ + +# 4.2. Performance Criteria + +We emphasize that no single criterion can sufficiently convey the full strength of any methodology; this is especially true in the multiobjective setting, in which different performance criteria already exist to quantify different algorithmic goals. We hope to impart a nuanced comparison of ECI to existing baselines. To that end, we consider the following four criteria. + +Fill distance: We want an algorithm that can effectively explore the entire satisfactory region. This is quantified by fill distance, which is defined in Equation 3. + +Positive samples: The number of satisfactory sampled points is commonly used in active search literature to judge the quality of the algorithm. In our experiments, these are the observed samples inside of $S$ . + +Hypervolume: We measure the hypervolume of region in metric space bounded by the Pareto frontier and the defined thresholds. In particular, we conjecture that algorithms which excel at maximizing the hypervolume may underperform on other criteria, and vice versa. + +Coverage recall: Finally, we want to combine the idea of maximizing positive samples and minimizing fill distance + +to measure sample diversity. We propose a recall metric that considers coverage. Given a known $S$ and samples $\mathbf{X}$ , we define the coverage recall as + +$$ +\text {C o v e r a g e} = | \mathrm {N} _ {r} (\mathbf {X}) \cap \mathcal {S} | / | \mathcal {S} |. +$$ + +Note that the numerator is exactly the utility function that we have proposed in Section 3.1. We will simply refer to this as recall in the following text. + +# 4.3. Multiobjective Design Problem Suite + +We adopt eight multiobjective engineering design problems presented in the REPROBLEM suite (Tanabe & Ishibuchi, 2020). These synthetic functions are specifically designed to mimic real-world applications and avoid having unrealistic properties of traditional benchmark functions. We follow the naming convention from the original text and detail the problems we selected in the supplement. + +# 4.4. Additive Manufacturing + +Haghanifar et al. (2020) studies a numerical simulation to help design an additive manufacturing strategy for minimizing the reflection of light at multiple angles of incidence. We conduct the same search for different nanostructures which balance a desire for minimizing normal reflection with reflection at an oblique angle. + +The simulation, conducted using the Numerical FDTD simulator (Lumerical Inc., 2020), has a level of inaccuracy associated with the numerical methods. In addition, there is a level of imprecision associated with the actual manufacturing process which means that the desired design parameters are only realized to limited precision during fabrication. Our goal for this reflection minimization problem is to find nanostructured glass that satisfying $R_{\mathrm{normal}}(\mathbf{x}) \leq \tau_{\mathrm{normal}}$ and $R_{\mathrm{oblique}}(\mathbf{x}) \leq \tau_{\mathrm{oblique}}$ . The design parameters are the dimension of the nanostructures (a cone): maximum cone width, bottom diameter, top diameter, and height of the structure. + +Table 1. Selected experimental results, consisting of the mean over 20 independent trials. Hypervolume has been rescaled for ease of viewing: $\mathrm{RE33\times 10^{-5}}$ , Additive $\times 10^{-2}$ , EEG $\times 10^{2}$ , Plasma $\times 10^{0}$ . We denote with bold text the best mean for each problem and each metric. Please refer to the supplementary material for the complete set of experimental results and information regarding the variation around the mean (standard error). For each problem, ECI has the best recall performance. + +
FunctionmdrMethodsFill distance ↓# Positive ↑Coverage Recall ↑Hypervolume ↑
RE33340.08RND0.3423.800.145.53
ONE-S0.60101.550.187.03
EZ0.2634.050.252.77
STRADDLE0.3513.700.102.92
BO0.4236.550.118.65
EISR0.24100.050.237.46
ECI0.27100.950.737.91
Additive2435.0RND108.2222.400.427.94
ONE-S211.86156.750.608.77
EZ92.37106.050.898.52
STRADDLE79.3021.100.437.78
BO107.84121.950.829.07
EISR102.01121.400.988.56
ECI34.9256.001.008.07
EEG260.25RND0.384.400.583.17
ONE-S0.4831.200.503.45
EZ0.4417.950.583.45
STRADDLE0.412.000.382.28
BO0.524.300.352.40
EISR0.4522.850.523.55
ECI0.388.300.793.65
Plasma³190.50RND1.0210.850.195.63
ONE-S1.0112.800.205.88
EZ1.0710.700.175.48
STRADDLE1.0710.700.175.48
BO1.0412.600.155.74
EISR1.0310.550.146.08
ECI0.9031.250.656.64
+ +# 4.5. EEG for Brain Activity Reconstruction + +Electroencephalography (EEG) is a non-invasive strategy for reconstructing cerebral electric currents from their resulting electrostatic potential measured on a human's scalp (Ala et al., 2017). This process consists of solving an inverse problem, requiring localization of the electric dipoles' locations and moments, subject to the associated model of dipole/potential interaction (Sorrentino & Piana, 2017). The limited spatial resolution of EEG is a well-known problem with its practical viability (Samuelsson et al., 2021), making constraint active search a potentially interesting tool for identifying regions of brain activity. + +We use a meshfree solver to generate a scalp potential from a proposed dipole location through a quasi-stationary approximation to Maxwell's equations (Ala et al., 2015). We then + +apply our strategy to identify the proposed dipole which most closely matches the true potential created by the true dipole, which is fixed at the start but hidden. We measure scalp potential at 28 locations and try to minimize the 25th and 75th percentiles of absolute deviation between the proposed and true potential; this has the effect of pushing both ends of the interquartile range as low as possible. + +# 4.6. Plasma Physics + +A stellarator is device that uses a set of magnetic coils to confine a plasma hot enough to sustain nuclear fusion (Spitzer Jr, 1958). Stellarator coils lack rotational symmetry, + +![](images/3eb3a37fbc55de1a77838e50137859bf891e628c5e1336439b2790c5ddeaf788.jpg) +Figure 4. Left two panels: difference from the expected design (in CAD) and the fabricated sample of a nanostructure. Right two panels: comparison of acceptable configurations in metric space and in the parameter space. Small variations in the Pareto optimal points can lead to significant discrepancies in the design space. CAS points provide more information about satisfactory design configuration. + +![](images/1658e3c9ed9082383c941e94e50b8b9874d0ac1ca17de7abc0427e50248de784.jpg) + +![](images/d892ebf90cd246d309275dc80922d76c52dd4e39cca005f59dd2b2d0113c3e19.jpg) + +![](images/827cf488d0af1df8098968472ea8203911f2a93f6dc8c3c251c039b1b3abb0d2.jpg) + +and possess notably warped shapes due to the complex, quasi-symmetric magnetic field they must produce. + +Recently, (Giuliani et al., 2020) developed a stellarator simulator, PyPlasmaOpt, which significantly streamlines the simulation procedure of previous packages such as StellOpt (Strickler et al., 2003). PyPlasmaOpt paramaterizes each coil as a curve in 3D Cartesian coordinates $\Gamma (\theta) = (x(\theta),y(\theta),z(\theta))$ , where each coordinate admits the following Fourier expansion, e.g., in the case of $x$ : + +$$ +x (\theta) = c _ {0} + \sum_ {k = 1} ^ {n _ {\text {o r d e r}}} s _ {k} \sin (k \theta) + c _ {k} \cos (k \theta). +$$ + +For each coil, the parameters $c_k$ and $s_k$ represent the search space that we must search over. We consider a relatively simple, order one coil which has nine parameters total. + +We compute the objective function to be minimized by simulating the stellarator using the given coil shapes (which solves a certain first order, nonlinear ordinary differential equation). The resulting summary information from the simulation is our objective $f$ and contains three terms: + +$$ +f (\mathbf {x}) = R _ {\text {m a g n e t i c}} (\mathbf {x}) + R _ {\text {t r a n s f o r m}} (\mathbf {x}) + R _ {\text {s h a p e}} (\mathbf {x}). +$$ + +The first term quantifies the quasi-symmetry of the magnetic field—the smaller the first term, the more desirable the resulting field. The second term locks the solution into a target rotational transform. The third term penalizes overly complex coils too impractical to manufacture in real life. + +# 4.7. Discussion + +We exhaustively tested ECI and other baselines on eleven total problems, but due to limited space, we present a representative subset of our experimental results in this section. Our analysis holds true for the seven additional problems, whose results are in the supplement along with accompanying experimental setups for reproducibility purposes. + +Specifically, Table 1 shows the mean value over 20 trials for + +each performance metric at termination for the RE33 function from the design problem suite and all our real-world applications. These results demonstrate that no algorithm can be the best in all performance metrics. In fact, it highlights each method's strengths and weaknesses, confirming our thesis that evaluating the performance of multiobjective problems is itself multiobjective. + +As expected, BO typically outperforms all methods on the hypervolume criterion, which only judges the Pareto frontier. However, it is consistently worse than its peers when judged by diversity (fill distance) and coverage (recall). Our proposed method ECI, on the other hand, is effective at diverse sampling inside the satisfactory region $S$ ; it is almost always the best performing method for coverage recall and fill distance. Unsurprisingly, ONE-S excels at accumulating satisfactory samples since it greedily maximizes the number of positive samples by design. These samples are highly clustered, as revealed by the high fill distance and low coverage recall values. + +Each policy's objective is evident when we consider the sample progression. Figure 3 shows the variation on performance as a function of the number of observed samples for the additive manufacturing problem. For instance, ECI maximizes the coverage recall and also minimizes the fill distance but stagnates at maximizing hypervolume and number of positives. + +Our investigation reveals that different multiobjective algorithms prioritize different performance criteria. Therefore, one can tailor a strategy (perhaps an ensemble of methods) according to each application's need. If metric optimization is of ultimate relevance, we recommend multiobjective Bayesian optimization. If the decision maker's goal is to identify rare elements regardless of diversity, then active search is the best choice. However, we argue that selecting a diverse set of satisfactory configurations is the most suited objective for design problems. We provide an example to support this claim in the following section. + +# 5. Constraint Active Search in Practice + +This research was motivated, in part, by a collaboration with materials scientists using additive manufacturing to fabricate nanostructured glass with multiple desirable optical and physical characteristics. Multiobjective problems are intrinsically subjective — if we could quantify the tradeoffs between each metric precisely a priori, we would solve a single-objective problem instead. Therefore, multiobjective methodologies provide the decision makers with a set of points at termination. Traditional multiobjective optimization offers a Pareto optimal set of points; our alternative gives a set of diverse points in parameter space that meet the user constraints. The decision maker, a domain expert, must then decide which one or more of these points to promote to physical manufacturing, often considering two key complications: + +- Computational and manufacturing imprecision prevent an exact physical realization of the results. See Figure 4 (left two panels) for an example of the CAD model and the associated fabricated component, which suffered from limited manufacturing precision. +- Some metrics are unavailable during optimization - maybe they can only be computed after manufacturing (such as anti-fogging or durability) or require costly expert analysis (such as the supervisor stating expert opinions on a manufacturing scale). + +Both of these complications are better addressed through sample diversity in parameter space (not in metric space) — the primary motivation of CAS. + +Inaccuracies arising from the transfer of computational results to manufactured outcomes are best dealt with by choosing points most likely to achieve acceptable performance after fabrication. Because CAS explores the parameter space, it has a greater ability to select results far (e.g., in Euclidean sense) from unacceptable outcomes than multiobjective optimization. When only studying the Pareto frontier, no energy is spent exploring the safety of those points from undesirable results. Figure 4 (right) shows the numerical simulation results for the additive manufacturing example; interior points in parameter space are more likely to be selected for physical manufacturing. + +For metrics only computable after fabrication, users benefit from a diverse set of designs in parameter space so they may manufacture a select few and still hope to achieve good results on these previously unavailable metrics. + +# 6. Conclusion and Future Work + +We introduce constraint active search as a novel methodology to explore multiobjective experimental design options while satisfying minimum performance criteria. One key + +differentiation between constraint active search and existing multiobjective optimization literature is the emphasis on the design parameters: constraint active search values sample diversity in the satisfactory region. + +We propose a new search policy, expected coverage improvement, designed to efficiently improve the coverage of sampled designs over the satisfactory region; theoretical properties of this strategy include a constant approximation ratio to the optimal sample diversity. We define and study several performance criteria when judging the performance of proposed algorithms in multiobjective settings, and we explain the implications of prioritizing each. Using these criteria, we compare our new policy against existing strategies such as Bayesian optimization, level set estimation, and active search on synthetic and real world problems. + +There are many open problems in the topic of constraint active search for design and simulation; here we prioritize a few topics for future investigation. + +Distinctness/Precision: A key element of ECI (as well as the active search baseline) is the choice of the resolution $r$ , through which the design precision is defined. This is acceptable, but limited: categorical parameters may exist; different parts of the domain may have different manufacturing precision; some parameters may have different levels of precision than others. Eventually, it would be beneficial to allow for a more abstract definition of design distinctness to support more complicated design circumstances. + +Unknown precision: In most design/manufacturing settings, the resolution $r$ is known a priori. It is possible, however, that this will need to be discovered over the course of the search process (or, maybe, after the search process). For this situation, our proposed policy would benefit from an adaptive $r$ definition, which might start at a very large value e.g., $10\%$ of the maximum distance between points in the domain, and then scale down as the search progresses. + +Parallelism: ECI is limited to the sequential setting; extending the search policy to the batch setting and finding a computationally tractable policy is non-trivial. + +Judging performance: Some of our proposed performance criteria are only computable for benchmark problems where the true satisfactory region can be estimated. In practice, judging the results of a search algorithm is less straightforward. We believe creating more practical performance criteria can accelerate our understanding of this problem. + +# Acknowledgements + +We want to thank Sajad Haghanifar and Paul Leu for providing the scanning electron microscope images and motivating the research presented in this paper. + +# References + +Ala, G., Fasshauer, G., Francomano, E., Ganci, S., and McCourt, M. J. The method of fundamental solutions in solving coupled boundary value problems for M/EEG. SIAM Journal on Scientific Computing, 37(4): B570-B590, 2015. +Ala, G., Fasshauer, G. E., Francomano, E., Ganci, S., and McCourt, M. J. An augmented MFS approach for brain activity reconstruction. Mathematics and Computers in Simulation, 141:3-15, 2017. +Ariafar, S., Coll-Font, J., Brooks, D., and Dy, J. ADMMBO: Bayesian optimization with unknown constraints using ADMM. Journal of Machine Learning Research, 20(123): 1-26, 2019. +Attia, P. M., Grover, A., Jin, N., Severson, K. A., Markov, T. M., Liao, Y.-H., Chen, M. H., Cheong, B., Perkins, N., Yang, Z., Herring, P. K., Aykol, M., Harris, S. J., Braatz, R. D., Ermon, S., and Chueh, W. C. Closed-loop optimization of fast-charging protocols for batteries with machine learning. Nature, 578(7795):397-402, 2020. ISSN 1476-4687. doi: 10.1038/s41586-020-1994-5. +Belakaria, S., Deshwal, A., and Doppa, J. R. Max-value entropy search for multi-objective Bayesian optimization. In Wallach, H. M., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E. B., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 7823-7833, 2019. +Belakaria, S., Deshwal, A., and Doppa, J. R. Max-value entropy search for multi-objective Bayesian optimization with constraints. Third Workshop on Machine Learning and the Physical Sciences (NeurIPS 2020), 2020. +Bryan, B. and Schneider, J. G. Actively learning level-sets of composite functions. In Cohen, W. W., McCallum, A., and Roweis, S. T. (eds.), Machine Learning, Proceedings of the Twenty-Fifth International Conference (ICML 2008), Helsinki, Finland, June 5-9, 2008, volume 307 of ACM International Conference Proceeding Series, pp. 80-87. ACM, 2008. doi: 10.1145/1390156.1390167. +Bryan, B., Schneider, J. G., Nichol, R., Miller, C. J., Genovese, C. R., and Wasserman, L. A. Active learning for identifying function threshold boundaries. In Advances in Neural Information Processing Systems 18 [Neural Information Processing Systems, NIPS 2005, December 5-8, 2005, Vancouver, British Columbia, Canada], pp. 163-170, 2005. + +Daulton, S., Balandat, M., and Bakshy, E. Differentiable expected hypervolume improvement for parallel multi-objective Bayesian optimization. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. +del Rosario, Z., Rupp, M., Kim, Y., Antonio, E., and Ling, J. Assessing the frontier: Active learning, model accuracy, and multi-objective candidate discovery and optimization. The Journal of Chemical Physics, 153(2):024112, 2020. doi: 10.1063/5.0006124. +Duris, J., Kennedy, D., Hanuka, A., Shtalenkova, J., Edelen, A., Baxevanis, P., Egger, A., Cope, T., McIntire, M., Ermon, S., and Ratner, D. Bayesian optimization of a free-electron laser. Phys. Rev. Lett., 124:124801, 2020. doi: 10.1103/PhysRevLett.124.124801. +Emmerich, M. T. M., Deutz, A. H., and Klinkenberg, J. W. Hypervolume-based expected improvement: Monotonicity properties and exact computation. In 2011 IEEE Congress of Evolutionary Computation (CEC), pp. 2147-2154, 2011. doi: 10.1109/CEC.2011.5949880. +Eriksson, D. and Poloczek, M. Scalable constrained Bayesian optimization. In Banerjee, A. and Fukumizu, K. (eds.), The 24th International Conference on Artificial Intelligence and Statistics, AISTATS 2021, April 13-15, 2021, Virtual Event, volume 130 of Proceedings of Machine Learning Research, pp. 730-738. PMLR, 2021. +Fasshauer, G. E. and McCourt, M. J. Kernel-based Approximation Methods Using Matlab. World Scientific, 2015. doi: 10.1142/9335. +Fernández-Sánchez, D., Garrido-Merchán, E. C., and Hernández-Lobato, D. Improved max-value entropy search for multi-objective Bayesian optimization with constraints, 2021. URL https://arxiv.org/abs/2011.01150. +Forrester, A., Sobester, A., and Keane, A. Engineering design via surrogate modelling: a practical guide. John Wiley & Sons, 2008. +Frazier, P. I. Bayesian optimization. In Gel, E. and Ntaimo, L. (eds.), *Recent Advances in Optimization and Modeling of Contemporary Problems*, pp. 255–278. INFORMS, 2018. +Gardner, J. R., Kusner, M. J., Xu, Z. E., Weinberger, K. Q., and Cunningham, J. P. Bayesian optimization with inequality constraints. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, + +Beijing, China, 21-26 June 2014, volume 32 of JMLR Workshop and Conference Proceedings, pp. 937-945. JMLR.org, 2014. +Garnett, R., Krishnamurthy, Y., Xiong, X., Schneider, J., and Mann, R. Bayesian optimal active search and surveying. In Proceedings of the 29th International Coference on International Conference on Machine Learning, ICML'12, pp. 843-850, Madison, WI, USA, 2012. Omnipress. ISBN 9781450312851. +Gelbart, M. A. Constrained Bayesian optimization and applications. PhD thesis, Harvard, 2015. +Giuliani, A., Wechsung, F., Cerfon, A., Stadler, G., and Landreman, M. Single-stage gradient-based stellarator coil design: Optimization for near-axis quasi-symmetry, 2020. URL https://arxiv.org/abs/2010.02033. +Gotovos, A., Casati, N., Hitz, G., and Krause, A. Active learning for level set estimation. In Rossi, F. (ed.), *IJCAI* 2013, Proceedings of the 23rd International Joint Conference on Artificial Intelligence, Beijing, China, August 3-9, 2013, pp. 1344-1350. *IJCAI/AAAI*, 2013. +Haghanifar, S., McCourt, M., Cheng, B., Wuenschell, J., Ohodnicki, P., and Leu, P. W. Discovering high-performance broadband and broad angle antireflection surfaces by machine learning. Optica, 7(7):784-789, 2020. doi: 10.1364/OPTICA.387938. +Iwazaki, S., Inatsu, Y., and Takeuchi, I. Bayesian experimental design for finding reliable level set under input uncertainty. IEEE Access, 8:203982-203993, 2020. doi: 10.1109/ACCESS.2020.3036863. +Jiang, S., Malkomes, G., Converse, G., Shofner, A., Moseley, B., and Garnett, R. Efficient nonmyopic active search. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pp. 1714-1723. PMLR, 2017. +Jiang, S., Malkomes, G., Abbott, M., Moseley, B., and Garnett, R. Efficient nonmyopic batch active search. In Bengio, S., Wallach, H. M., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 1107-1117, 2018. +Joy, C., Boyle, P. P., and Tan, K. S. Quasi-Monte Carlo methods in numerical finance. Management Science, 42 (6):926-938, 1996. + +Knowles, J. ParEGO: a hybrid algorithm with on-line landscape approximation for expensive multiobjective optimization problems. IEEE Transactions on Evolutionary Computation, 10(1):50-66, 2006. doi: 10.1109/TEVC.2005.851274. +Konakovic-Lukovic, M., Tian, Y., and Matusik, W. Diversity-guided multi-objective Bayesian optimization with batch evaluations. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. +Koziel, S., Bekasiewicz, A., Couckuyt, I., and Dhaene, T. Efficient multi-objective simulation-driven antenna design using co-Kriging. IEEE Transactions on Antennas and Propagation, 62(11):5900-5905, 2014. +Letham, B., Karrer, B., Ottoni, G., and Bakshy, E. Constrained Bayesian optimization with noisy experiments. Bayesian Anal., 14(2):495-519, 2019. doi: 10.1214/18-BA1110. +Lumerical Inc. Lumerical device multiphysics simulation suite, FDTD solver, 2020. URL https://www.lumerical.com/products/. +Molesky, S., Lin, Z., Piggott, A. Y., Jin, W., Vuckovic, J., and Rodriguez, A. W. Inverse design in nanophotonics. Nature Photonics, 12(11):659-670, 2018. +Negoescu, D. M., Frazier, P. I., and Powell, W. B. The knowledge-gradient algorithm for sequencing experiments in drug discovery. INFORMS Journal on Computing, 23(3):346-363, 2011. +Paria, B., Kandasamy, K., and Poczos, B. A flexible framework for multi-objective Bayesian optimization using random scalarizations. In Adams, R. P. and Gogate, V. (eds.), Proceedings of The 35th Uncertainty in Artificial Intelligence Conference, volume 115 of Proceedings of Machine Learning Research, pp. 766-776, Tel Aviv, Israel, 2020. PMLR. +Pronzato, L. and Müller, W. G. Design of computer experiments: space filling and beyond. Statistics and Computing, 22(3):681-701, 2012. +Rasmussen, C. E. and Williams, C. K. I. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press, 2005. +Samuelsson, J. G., Peled, N., Mamashli, F., Ahveninen, J., and Hämäläinen, M. S. Spatial fidelity of MEG/EEG source estimates: A general evaluation approach. NeuroImage, 224:117430, 2021. + +Singh, P., Couckuyt, I., Elsayed, K., Deschrijver, D., and Dhaene, T. Shape optimization of a cyclone separator using multi-objective surrogate-based optimization. Applied Mathematical Modelling, 40(5-6):4248-4259, 2016. +Song, J., Tokpanov, Y. S., Chen, Y., Fleischman, D., Fountaine, K. T., Atwater, H. A., and Yue, Y. Optimizing photonic nanostructures via multi-fidelity Gaussian processes. NeurIPS Workshop on Machine Learning for Molecules and Materials, 2018. +Sorrentino, A. and Piana, M. Inverse modeling for MEG/EEG data. In Mathematical and Theoretical Neuroscience, pp. 239-253. Springer, 2017. +Spitzer Jr, L. The stellarator concept. The Physics of Fluids, 1(4):253-264, 1958. +Strickler, D., Berry, L., and Hirshman, S. Integrated plasma and coil optimization for compact stellarators. Technical report, International Atomic Energy Agency (IAEA), 2003. +Sui, Y., Gotovos, A., Burdick, J. W., and Krause, A. Safe exploration for optimization with Gaussian processes. In Bach, F. R. and Blei, D. M. (eds.), Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pp. 997-1005. JMLR.org, 2015. +Sui, Y., Zhuang, V., Burdick, J. W., and Yue, Y. Stagewise safe bayesian optimization with Gaussian processes. In Dy, J. G. and Krause, A. (eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pp. 4788-4796. PMLR, 2018. +Tanabe, R. and Ishibuchi, H. An easy-to-use real-world multi-objective optimization problem suite. Applied Soft Computing, 89:106078, 2020. ISSN 1568-4946. doi: https://doi.org/10.1016/j.asoc.2020.106078. +Wang, Z., Garrett, C. R., Kaelbling, L. P., and Lozano-Perez, T. Active model learning and diverse action sampling for task and motion planning. In International Conference on Intelligent Robots and Systems (IROS), 2018. +Zanette, A., Zhang, J., and Kochenderfer, M. J. Robust super-level set estimation using Gaussian processes. In Berlingerio, M., Bonchi, Francesco and Gartner, T., Hurley, N., and Ifrim, G. (eds.), Machine Learning and Knowledge Discovery in Databases, pp. 276-291, Cham, 2019. Springer International Publishing. ISBN 978-3-030-10928-8. \ No newline at end of file diff --git a/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/images.zip b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..67eee55075852e6d3f980702204f400b4a1e2521 --- /dev/null +++ b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72411adea7fd8ab2fda34a4531ae85f126d29710d6e7c757c1db25c568470daa +size 478837 diff --git a/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/layout.json b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e1132b7c374a87490be8f1293caf9aa01dc6728e --- /dev/null +++ b/beyondtheparetoefficientfrontierconstraintactivesearchformultiobjectiveexperimentaldesign/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6b42699a9a192428c32f31290796dfb0e10e690523b07094f401b7ea5910c31 +size 469575 diff --git a/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_content_list.json b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e974d1a33c3e1a573bd45fe5bc589fbcb7beeb09 --- /dev/null +++ b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a25cb1358177e65e0a6adad3b011e65996f3e3b9c64273cdf0c0d44fc59bff9d +size 82933 diff --git a/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_model.json b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1afcef001153bc982a44fc62ba009204b2ae77cc --- /dev/null +++ b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e98dc509e9e7c0b55d6f9130d115a2b3770f96415400286060aa44c05dcf2a06 +size 101528 diff --git a/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_origin.pdf b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..58f78af272772e189f06d7ac457c307892a56f10 --- /dev/null +++ b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/8fb65546-77b7-470e-a289-a8ec29c03a6b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e6d4bb2816c7cbecf3912b5a38339ca61aa4a7534d9e1614068081736f125a6 +size 3857429 diff --git a/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/full.md b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2e1d043dfdaccc817d2d305f917cf9bbb93e3e80 --- /dev/null +++ b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/full.md @@ -0,0 +1,345 @@ +# Beyond Variance Reduction: Understanding the True Impact of Baselines on Policy Optimization + +Wesley Chung $^{*1}$ Valentin Thomas $^{*2}$ Marlos C. Machado $^{3,4,5}$ Nicolas Le Roux $^{6,12}$ + +# Abstract + +Bandit and reinforcement learning (RL) problems can often be framed as optimization problems where the goal is to maximize average performance while having access only to stochastic estimates of the true gradient. Traditionally, stochastic optimization theory predicts that learning dynamics are governed by the curvature of the loss function and the noise of the gradient estimates. In this paper we demonstrate that the standard view is too limited for bandit and RL problems. To allow our analysis to be interpreted in light of multi-step MDPs, we focus on techniques derived from stochastic optimization principles (e.g., natural policy gradient and EXP3) and we show that some standard assumptions from optimization theory are violated in these problems. We present theoretical results showing that, at least for bandit problems, curvature and noise are not sufficient to explain the learning dynamics and that seemingly innocuous choices like the baseline can determine whether an algorithm converges. These theoretical findings match our empirical evaluation, which we extend to multi-state MDPs. + +# 1. Introduction + +In the standard multi-arm bandit setting (Robbins, 1952), an agent needs to choose, at each timestep $t$ , an arm $a_{t} \in \{1,\dots,n\}$ to play, receiving a potentially stochastic reward $r_t$ with mean $\mu_{a_t}$ . The goal of the agent is usually to maximize the total sum of rewards, $\sum_{i=1}^{T} r_i$ , or to maximize the average performance at time $T$ , $\mathbb{E}_{i \sim \pi} \mu_i$ with $\pi$ being the probability of the agent of drawing each arm (Bubeck + +*Equal contribution ¹Mila, McGill University ²Mila, University of Montreal ³DeepMind ⁴Amii, University of Alberta ⁵Work partially done at Google Research ⁶Google Research, Brain Team. Correspondence to: . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +& Cesa-Bianchi, 2012). While the former measure is often used in the context of bandits, $^{1}$ $\mathbb{E}_{i\sim \pi}\mu_{i}$ is more common in the context of Markov Decision Processes (MDPs), which have multi-arm bandits as a special case. + +In this paper we focus on techniques derived from stochastic optimization principles, such as EXP3 (Auer et al., 2002; Seldin et al., 2013). In particular, we study policy gradient methods, a family of algorithms useful in the more general MDP setting which have seen empirical success in recent times (Schulman et al., 2017). + +We analyze the problem of learning to maximize the average reward, $J$ , by gradient ascent: + +$$ +\theta^ {*} = \arg \max _ {\theta} J (\theta) = \arg \max _ {\theta} \sum_ {a} \pi_ {\theta} (a) \mu_ {a}, \tag {1} +$$ + +with $\mu_{a}$ being the average reward of arm $a$ . In this case, we are mainly interested in outputting an effective policy at the end of the optimization process, without explicitly considering the performance of intermediary policies. + +Optimization theory predicts that the convergence speed of stochastic gradient methods will be affected by the variance of the gradient estimates and by the geometry of the function $J$ , represented by its curvature. Roughly speaking, the geometry dictates how effective true gradient ascent is at optimizing $J(\theta)$ while the variance can be viewed as a penalty, capturing how much slower the optimization process is by using noisy versions of this true gradient. More concretely, doing one gradient step with stepsize $\alpha$ , using a stochastic estimate $g_{t}$ of the gradient, leads to (Bottou et al., 2018): + +$$ +\mathbb {E} \left[ J \left(\theta_ {t + 1}\right) \right] - J \left(\theta_ {t}\right) \geq \left(\alpha - \frac {L \alpha^ {2}}{2}\right) \| \mathbb {E} [ g _ {t} ] \| _ {2} ^ {2} - \frac {L \alpha^ {2}}{2} \operatorname {V a r} [ g _ {t} ], +$$ + +when $J$ is $L$ -smooth, i.e. its gradients are $L$ -Lipschitz. + +As large variance has been identified as an issue for policy gradient (PG) methods, many works have focused on reducing the noise of the updates. One common technique is the use of control variates (Greensmith et al., 2004; Hofmann et al., 2015), referred to as baselines in the context of RL. These baselines $b$ are subtracted from the observed returns to obtain shifted returns, $r(a_{i}) - b$ , and do not change the + +expectation of the gradient. In MDPs, they are typically state-dependent. While the value function is a common choice, previous work showed that the minimum-variance baseline for the REINFORCE (Williams, 1992) estimator is different and involves the norm of the gradient (Peters & Schaal, 2008). Reducing variance has been the main motivation for many previous works on baselines (e.g., Gu et al., 2016; Liu et al., 2017; Grathwohl et al., 2017; Wu et al., 2018; Cheng et al., 2020), but the influence of baselines on other aspects of the optimization process has hardly been studied. We take a deeper look at baselines and their effects on optimization. + +# CONTRIBUTIONS + +We show that baselines can impact the optimization process beyond variance reduction and lead to qualitatively different learning curves, even when the variance of the gradients is the same. For instance, given two baselines with the same variance, the more negative baseline promotes committal behaviour where a policy quickly tends towards a deterministic one, while the more positive baseline leads to non-committal behaviour, where the policy retains higher entropy for a longer period. + +Furthermore, we show that the choice of baseline can even impact the convergence of natural policy gradient (NPG), something variance cannot explain. In particular, we construct a three-armed bandit where using the baseline minimizing the variance can lead to convergence to a deterministic, sub-optimal policy for any positive stepsize, while another baseline, with larger variance, guarantees convergence to the optimal policy. As such a behaviour is impossible under the standard assumptions in optimization, this result shows how these assumptions may be violated in practice. It also provides a counterexample to the convergence of NPG algorithms in general, a popular variant with much faster convergence rates than vanilla PG when using the true gradient in tabular MDPs (Agarwal et al., 2019). + +Further, we identify on-policy sampling as a key factor to these convergence issues as it induces a vicious cycle where making bad updates can lead to worse policies, in turn leading to worse updates. A natural solution is to break the dependency between the sampling distribution and the updates through off-policy sampling. We show that ensuring all actions are sampled with sufficiently large probability at each step is enough to guarantee convergence in probability. Note that this form of convergence is stronger than convergence of the expected iterates, a more common type of result (e.g., Mei et al., 2020b; Agarwal et al., 2019). + +We also perform an empirical evaluation on multi-step MDPs, showing that baselines have a similar impact in that setting. We observe a significant impact on the empirical performance of agents when using two different sets of + +basielines yielding the same variance, once again suggesting that learning dynamics in MDPs are governed by more than the curvature of the loss and the variance of the gradients. + +# 2. Baselines, learning dynamics & exploration + +The problem defined in Eq. 1 can be solved by gradient ascent. Given access only to samples, the true gradient cannot generally be computed and the true update is replaced with a stochastic one, resulting in the following update: + +$$ +\theta_ {t + 1} = \theta_ {t} + \frac {\alpha}{N} \sum_ {i} r \left(a _ {i}\right) \nabla_ {\theta} \log \pi_ {\theta} \left(a _ {i}\right), \tag {2} +$$ + +where $a_i$ are actions drawn according to the agent's current policy $\pi_{\theta}$ , $\alpha$ is the stepsize, and $N$ , which can be 1, is the number of samples used to compute the update. To reduce the variance of this estimate without introducing bias, we can introduce a baseline $b$ , resulting in the gradient estimate $(r(a_i) - b)\nabla_{\theta}\log \pi_{\theta}(a_i)$ . + +While the choice of baseline is known to affect the variance, we show that baselines can also lead to qualitatively different behaviour of the optimization process, even when the variance is the same. This difference cannot be explained by the expectation or variance, quantities which govern the usual bounds for convergence rates (Bottou et al., 2018). + +# 2.1. Committal and non-committal behaviours + +To provide a complete picture of the optimization process, we analyze the evolution of the policy during optimization. We start in a simple setting, a deterministic three-armed bandit, where it is easier to produce informative visualizations. + +To eliminate variance as a potential confounding factor, we consider different baselines with the same variance. We start by computing the baseline leading to the minimum-variance of the gradients for the algorithm we use. For vanilla policy gradient, we have $b_{\theta}^{*} = \frac{\mathbb{E}[r(a_{i})\|\nabla\log\pi_{\theta}(a_{i})\|_{2}^{2}]}{\mathbb{E}[\|\nabla\log\pi_{\theta}(a_{i})\|_{2}^{2}]}$ (Peters & Schaal, 2008; Greensmith et al., 2004) (see Appendix D.1 for details and the NPG version). Note that this baseline depends on the current policy and changes throughout the optimization. As the variance is a quadratic function of the baseline, the two baselines $b_{\theta}^{+} = b_{\theta}^{*} + \epsilon$ and $b_{\theta}^{-} = b_{\theta}^{*} - \epsilon$ result in gradients with the same variance (see Appendix D.4 for details). Thus, we use these two perturbed baselines to demonstrate that there are phenomena in the optimization process that variance cannot explain. + +Fig. 1 presents fifteen learning curves on the probability simplex representing the space of possible policies for the three-arm bandit, when using NPG and a softmax parameterization. We choose $\epsilon = 1/2$ to obtain two baselines with the same variance: $b_{\theta}^{+} = b_{\theta}^{*} + 1/2$ and $b_{\theta}^{-} = b_{\theta}^{*} - 1/2$ . + +Inspecting the plots, the learning curves for $\epsilon = -1 / 2$ and + +![](images/79c8424993c8cd07acbcb486e6803fec87083030aefa543c5c90060d164797f3.jpg) +(a) $b_{\theta}^{-} = b_{\theta}^{*} - 1 / 2$ + +![](images/ebaa7ba3b2dfff14a3f86fc2923daf4e13cfd0d13f58b03b98b51cada8f2215f.jpg) +(b) $b_{\theta} = b_{\theta}^{*}$ + +![](images/6eb2d179cd5fd058f560c77a32e8ff64374cae9fc2ae6989de1a4e013f5266cb.jpg) +(c) $b_{\theta}^{+} = b_{\theta}^{*} + 1 / 2$ +Figure 1: We plot 15 different trajectories of natural policy gradient with softmax parameterization, when using various baselines, on a 3-arm bandit problem with rewards $(1,0.7,0)$ and stepsize $\alpha = 0.025$ and $\theta_0 = (0,3,5)$ . The black dot is the initial policy and colors represent time, from purple to yellow. The dashed black line is the trajectory when following the true gradient (which is unaffected by the baseline). Different values of $\epsilon$ denote different perturbations to the minimum-variance baseline. We see some cases of convergence to a suboptimal policy for both $\epsilon = -1/2$ and $\epsilon = 0$ . This does not happen for the larger baseline $\epsilon = 1/2$ or the value function as baseline. Figure made with Ternary (Harper & Weinstein, 2015). + +![](images/a394ffa671eb381a59c10e5979fc515ca84f0c11103ee46419c5130326b8db2d.jpg) +(d) $b_{\theta} = V^{\pi_{\theta}}$ + +$\epsilon = 1/2$ are qualitatively different, even though the gradient estimates have the same variance. For $\epsilon = -1/2$ , the policies quickly reach a deterministic policy (i.e., a neighborhood of a corner of the probability simplex), which can be suboptimal, as indicated by the curves ending up at the policy choosing action 2. On the other hand, for $\epsilon = 1/2$ , every learning curve ends up at the optimal policy, although the convergence might be slower. The learning curves also do not deviate much from the curve for the true gradient. Again, these differences cannot be explained by the variance since the baselines result in identical variances. + +Additionally, for $b_{\theta} = b_{\theta}^{*}$ , the learning curves spread out further. Compared to $\epsilon = 1/2$ , some get closer to the top corner of the simplex, leading to convergence to a suboptimal solution, suggesting that the minimum-variance baseline may be worse than other, larger baselines. In the next section, we theoretically substantiate this and show that, for NPG, it is possible to converge to a suboptimal policy with the minimum-variance baseline; but there are larger baselines that guarantee convergence to an optimal policy. + +We look at the update rules to explain these different behaviours. When using a baseline $b$ with NPG, sampling $a_{i}$ results in the update + +$$ +\begin{array}{l} \theta_ {t + 1} = \theta_ {t} + \alpha \left[ r \left(a _ {i}\right) - b \right] F _ {\theta} ^ {- 1} \nabla_ {\theta} \log \pi_ {\theta} \left(a _ {i}\right) \\ = \theta_ {t} + \alpha \frac {r (a _ {i}) - b}{\pi_ {\theta} (a _ {i})} \mathbf {1} _ {a _ {i}} + \alpha \lambda e \\ \end{array} +$$ + +where $F_{\theta}^{-1} = \mathbb{E}_{a\sim \pi}[\nabla \log \pi_{\theta}(a)\nabla \log \pi_{\theta}(a)^{\top}],\mathbf{1}_{a_i}$ is a one-hot vector with 1 at index $i$ , and $\lambda e$ is a vector containing $\lambda$ in each entry. The second line follows for the softmax policy (see Appendix D.2) and $\lambda$ is arbitrary since shifting $\theta$ by a constant does not change the policy. + +Thus, supposing we sample action $a_{i}$ , if $r(a_{i}) - b$ is positive, + +which happens more often when the baseline $b$ is small (more negative), the update rule will increase the probability $\pi_{\theta}(a_i)$ . This leads to an increase in the probability of taking the actions the agent took before, regardless of their quality (see Fig.1a for $\epsilon = -1/2$ ). Because the agent is likely to choose the same actions again, we call this committal behaviour. + +While a smaller baseline leads to committal behaviour, a larger (more positive) baseline makes the agent second-guess itself. If $r(a_i) - b$ is negative, which happens more often when $b$ is large, the parameter update decreases the probability $\pi_{\theta}(a_i)$ of the sampled action $a_i$ , reducing the probability the agent will re-take the actions it just took, while increasing the probability of other actions. This might slow down convergence but it also makes it harder for the agent to get stuck. This is reflected in the $\epsilon = 1/2$ case (Fig.1c), as all the learning curves end up at the optimal policy. We call this non-committal behaviour. + +While the previous experiments used perturbed variants of the minimum-variance baseline to control for the variance, this baseline would usually be infeasible to compute in more complex MDPs. Instead, a more typical choice of baseline would be the value function (Sutton & Barto, 2018, Ch. 13), which we evaluate in Fig. 1d. Choosing the value function as a baseline generated trajectories converging to the optimal policy, even though their convergence may be slow, despite it not being the minimum variance baseline. The reason becomes clearer when we write the value function as $V^{\pi} = b_{\theta}^{*} - \frac{\mathrm{Cov}(r,\|\nabla\log\pi\|^{2})}{\mathbb{E}[\|\nabla\log\pi\|^{2}]}$ (see Appendix D.3). The term $\mathrm{Cov}(r,\|\nabla\log\pi\|^{2})$ typically becomes negative as the gradient becomes smaller on actions with high rewards during the optimization process, leading to the value function being a noncommittal baseline, justifying a choice often made by practitioners. + +Additional empirical results can be found in Appendix A.1 for natural policy gradient and vanilla policy gradient for the softmax parameterization. Furthermore, we explore the use of different parameterizations: First, we testprojected stochastic gradient ascent and directly optimizing the policy probabilities $\pi_{\theta}(a)$ . Next, we try the escort transform (Mei et al., 2020a), which was designed to improve the curvature of the objective. We find qualitatively similar results in all cases; baselines can induce committal and non-committal behaviour. + +# 3. Convergence to suboptimal policies with natural policy gradient (NPG) + +We empirically showed that PG algorithms can reach suboptimal policies and that the choice of baseline can affect the likelihood of this occurring. In this section, we provide theoretical results proving that it is indeed possible to converge to a suboptimal policy when using NPG. We discuss how this finding fits with existing convergence results and why standard assumptions are not satisfied in this setting. + +# 3.1. A simple example + +Standard convergence results assume access to the true gradient (e.g., Agarwal et al., 2019) or, in the stochastic case, assume that the variance of the updates is uniformly bounded for all parameter values (e.g., Bottou et al., 2018). These assumptions are in fact quite strong and are violated in a simple two-arm bandit problem with fixed rewards. Pulling the optimal arm gives a reward of $r_1 = +1$ , while pulling the suboptimal arm leads to a reward of $r_0 = 0$ . We use the sigmoid parameterization and call $p_t = \sigma(\theta_t)$ the probability of sampling the optimal arm at time $t$ . + +Our stochastic estimator of the natural gradient is + +$$ +g _ {t} = \left\{ \begin{array}{l} \frac {1 - b}{p _ {t}}, \text {w i t h p r o b a b i l i t y} p _ {t} \\ \frac {b}{1 - p _ {t}}, \text {w i t h p r o b a b i l i t y} 1 - p _ {t}, \end{array} \right. +$$ + +where $b$ is a baseline that does not depend on the action sampled at time $t$ but may depend on $\theta_t$ . By computing the variance of the updates, $\mathrm{Var}[g_t] = \frac{(1 - p_t - b)^2}{p_t(1 - p_t)}$ , we notice it is unbounded when the policy becomes deterministic, i.e. $p_t \to 0$ or $p_t \to 1$ , violating the assumption of uniformly bounded variance, unless $b = 1 - p_t$ , which is the optimal baseline. Note that using vanilla (non-natural) PG would, on the contrary, yield a bounded variance. In fact, we prove a convergence result in its favour in Appendix B (Prop. 4). + +For NPG, the proposition below establishes potential convergence to a suboptimal arm and we demonstrate this empirically in Fig. 2. + +Proposition 1. Consider a two-arm bandit with rewards 1 and 0 for the optimal and suboptimal arms, respectively. + +![](images/7f5b62f0ece6d902927421c46529c15ff5ed7de8205fe7fe7f1145b25de21d48.jpg) +(a) $\alpha = 0.05$ + +![](images/9ec80a6256b463db054fbcd803cec59688b45b135e227c001d463565d689f8f0.jpg) +(b) $\alpha = 0.1$ +Figure 2: Learning curves for 100 runs of 200 steps, on the two-arm bandit, with baseline $b = -1$ for three different step sizes $\alpha$ . Blue: Curves converging to the optimal policy. Red: Curves converging to a suboptimal policy. Black: Avg. performance. The number of runs that converged to the suboptimal solution are $5\%$ , $14\%$ and $22\%$ for the three $\alpha$ 's. Larger $\alpha$ 's are more prone to getting stuck at a suboptimal solution but settle on a deterministic policy more quickly. + +![](images/6b5f401dfe04c620652548f9f9265e38720fad6adb10f5a578317b00fe447e15.jpg) +(c) $\alpha = 0.15$ + +Suppose we use natural policy gradient starting from $\theta_0$ , with a fixed baseline $b < 0$ , and fixed stepsize $\alpha > 0$ . If the policy samples the optimal action with probability $\sigma(\theta)$ , then the probability of picking the suboptimal action forever and having $\theta_t$ go to $-\infty$ is strictly positive. Additionally, if $\theta_0 \leq 0$ , we have + +$P(\text{suboptimal action forever}) \geq (1 - e^{\theta_0})(1 - e^{\theta_0 + \alpha b})^{-\frac{1}{\alpha b}}.$ + +Proof. All the proofs may be found in the appendix. $\square$ + +The updates provide some intuition as to why there is convergence to suboptimal policies. The issue is the committal nature of the baseline. Choosing an action leads to an increase of that action's probability, even if it is a poor choice. Choosing the suboptimal arm leads to a decrease in $\theta$ by $\frac{\alpha b}{1 - p_t}$ , thus increasing the probability the same arm is drawn again and further decreasing $\theta$ . By checking the probability of this occurring forever, $P(\text{suboptimal arm forever}) = \prod_{t=1}^{\infty} (1 - p_t)$ , we show that $1 - p_t$ converges quickly enough to 1 that the infinite product is nonzero, showing it is possible to get trapped choosing the wrong arm forever (Prop. 1), and $\theta_t \to -\infty$ as $t$ grows. + +This issue could be solved by picking a baseline with lower variance. For instance, the minimum-variance baseline $b = 1 - p_t$ leads to 0 variance and both possible updates are equal to $+\alpha$ , guaranteeing that $\theta \to +\infty$ , thus convergence. In fact, any baseline $b \in (0,1)$ suffices since both updates are positive and greater than $\alpha \min(b, 1 - b)$ . However, this is not always the case, as we show in the next section. + +To decouple the impact of the variance with that of the committal nature of the baseline, Prop. 2 analyzes the learning dynamics in the two-arm bandit case for perturbations of the optimal baseline, i.e. we study baselines of the form $b = b^{*} + \epsilon$ and show how $\epsilon$ , and particularly its sign, affects learning. Note that, because the variance is a quadratic func + +tion with its minimum in $b^{*}$ , both $+\epsilon$ and $-\epsilon$ have the same variance. Our findings can be summarized as follows: + +Proposition 2. For the two-armed bandit defined in Prop. 1, when using a perturbed min-variance baseline $b = b^{*} + \epsilon$ , the value of $\epsilon$ determines the learning dynamics as follows: + +- For $\epsilon < -1$ , there is a positive probability of converging to the suboptimal arm. +- For $\epsilon \in (-1, 1)$ , we have convergence in probability to the optimal policy. +- For $\epsilon \geq 1$ , the supremum of the iterates goes to $+\infty$ in probability. + +While the proofs can be found in Appendix B.2, we provide here some intuition behind these results. + +For $\epsilon < -1$ , we reuse the same argument as for $b < 0$ in Prop. 1. The probability of drawing the correct arm can decrease quickly enough to lead to convergence to the suboptimal arm. + +For $\epsilon \in (-1, 1)$ , the probability of drawing the correct arm cannot decrease too fast. Hence, although the updates, as well as the variance of the gradient estimate, are potentially unbounded, we still have convergence to the optimal solution in probability. + +Finally, for $\epsilon \geq 1$ , we can reuse an intermediate argument from the $\epsilon \in (0,1)$ case to argue that for any threshold $C$ , the parameter will eventually exceed that threshold. For $\epsilon \in (0,1)$ , once a certain threshold is crossed, the policy is guaranteed to improve at each step. However, with a large positive perturbation, updates are larger and we lose this additional guarantee, leading to the weaker result. + +We want to emphasize that not only we get provably different dynamics for $\epsilon < -1$ and $\epsilon \geq 1$ , showing the importance of the sign of the perturbation, but that there also is a sharp transition around $|\epsilon| = 1$ , which cannot be captured solely by the variance. + +The above analysis was specific to these updates. To predict committal vs. non-committal behaviour more generally, it may be possible to utilize higher order moments or other distributional properties, even when the mean and variance is the same. Unfortunately, it is difficult to utilize higher-moment information in theoretical bounds in a general manner as Markov-type inequalities do not take into account the sign of the higher moment, which we think is where the committal vs. non-committal distinction would appear. + +# 3.2. Reducing variance with baselines can be detrimental + +As we saw with the two-armed bandit, the direction of the updates is important in assessing convergence. More specifically, problems can arise when the choice of baseline + +induces committal behaviour. We now show a different bandit setting where committal behaviour happens even when using the minimum-variance baseline, thus leading to convergence to a suboptimal policy. Furthermore, we design a better baseline which ensures all updates move the parameters towards the optimal policy. This cements the idea that the quality of parameter updates must not be analyzed in terms of variance but rather in terms of the probability of going in a bad direction, since a baseline that induces higher variance leads to convergence while the minimum-variance baseline does not. The following theorem summarizes this. + +Theorem 1. There exists a three-arm bandit where using the stochastic natural gradient on a softmax-parameterized policy with the minimum-variance baseline can lead to convergence to a suboptimal policy with probability $\rho > 0$ , and there is a different baseline (with larger variance) which results in convergence to the optimal policy with probability 1. + +The bandit used in this theorem is the one we used for the experiments depicted in Fig. 1. The key is that the minimum-variance baseline can be lower than the second best reward; so pulling the second arm will increase its probability and induce committal behaviour. This can cause the agent to prematurely commit to the second arm and converge to the wrong policy. On the other hand, using any baseline whose value is between the optimal reward and the second best reward, which we term a gap baseline, will always increase the probability of the optimal action at every step, no matter which arm is drawn. Since the updates are sufficiently large at every step, this is enough to ensure convergence with probability 1, despite the higher variance compared to the minimum variance baseline. The key is that whether a baseline underestimates or overestimates the second best reward can affect the algorithm convergence and this is more critical than the resulting variance of the gradient estimates. + +As such, more than lower variance, good baselines are those that can assign positive effective returns to the good trajectories and negative effective returns to the others. These results cast doubt on whether finding baselines which minimize variance is a meaningful goal to pursue. The baseline can affect optimization in subtle ways, beyond variance, and further study is needed to identify the true causes of some improved empirical results observed in previous works. This importance of the sign of the returns, rather than their exact value, echoes with the cross-entropy method (De Boer et al., 2005), which maximizes the probability of the trajectories with the largest returns, regardless of their actual value. + +# 4. Off-policy sampling + +So far, we have seen that committal behaviour can be problematic as it can cause convergence to a suboptimal policy. + +This can be especially problematic when the agent follows a near-deterministic policy as it is unlikely to receive different samples which would move the policy away from the closest deterministic one, regardless of the quality of that policy. + +Up to this point, we assumed that actions were sampled according to the current policy, a setting known as on-policy. This setting couples the updates and the policy and is a root cause of the committal behaviour: the update at the current step changes the policy, which affects the distribution of rewards obtained and hence the next updates. However, we know from the optimization literature that bounding the variance of the updates will lead to convergence (Bottou et al., 2018). As the variance becomes unbounded when the probability of drawing some actions goes to 0, a natural solution to avoid these issues is to sample actions from a behaviour policy that selects every action with sufficiently high probability. Such a policy would make it impossible to choose the same, suboptimal action forever. + +# 4.1. Convergence guarantees with IS + +Because the behaviour policy changed, we introduce importance sampling (IS) corrections to preserve the unbiased updates (Kahn & Harris, 1951; Precup, 2000). These changes are sufficient to guarantee convergence for any baseline: + +Proposition 3. Consider a $n$ -armed bandit with stochastic rewards with bounded support and a unique optimal action. The behaviour policy $\mu_t$ selects action $i$ with probability $\mu_t(i)$ and let $\epsilon_t = \min_i \mu_t(i)$ . When using NPG with importance sampling and a bounded baseline $b$ , if $\lim_{t \to \infty} t \epsilon_t^2 = +\infty$ , then the target policy $\pi_t$ converges to the optimal policy in probability. + +Proof. (Sketch) Using Azuma-Hoeffding's inequality, we can show that for well chosen constants $\Delta_i$ , $\delta$ and $C > 0$ , + +$$ +\mathbb {P} \left(\theta_ {t} ^ {1} \geq \theta_ {0} ^ {1} + \alpha \delta \Delta_ {1} t\right) \geq 1 - \exp \left(- \frac {\delta^ {2} \Delta_ {1} ^ {2}}{2 C ^ {2}} t \epsilon_ {t} ^ {2}\right) +$$ + +where $\theta^1$ is the parameter associated to the optimal arm. Thus if $\lim_{t\to \infty}t\epsilon_t^2 = +\infty$ , the RHS goes to 1. In a similar manner, we can upper bound $\mathbb{P}\left(\theta_t^i\geq \theta_0^i +\alpha \delta \Delta_it\right)$ for all suboptimal arms, and applying an union bound, we get the desired result. + +The condition on $\mu_t$ imposes a cap on how fast the behaviour policy can become deterministic: no faster than $t^{-1/2}$ . Intuitively, this ensures each action is sampled sufficiently often and prevents premature convergence to a suboptimal policy. The condition is satisfied for any sequence of behaviour policies which assign at least $\epsilon_t$ probability to each action at each step, such as $\epsilon$ -greedy policies. It also holds if $\epsilon_t$ decreases over time at a sufficiently slow rate. By choosing as behaviour policy $\mu$ a linear interpolation between $\pi$ and + +![](images/433881678f48ccedc43b64bfa594758f7c7bf03ae0df4d34687f179a3f40302c.jpg) +(a) $b = 0 / \mathrm{IS}$ + +![](images/3822516772b7d17aa65f32722e3fa3056385ac66a85b79e499a48cc78f2dd4dc.jpg) +(b) $b = 0 / b^{*}$ +Figure 3: Comparison between the variance of different methods on a 3-arm bandit. Each plot depicts the log of the ratio between the variance of two approaches. For example, Fig. (a) depicts $\log \frac{\operatorname{Var}[g_{b = 0}]}{\operatorname{Var}[g_{\mathrm{IS}}]}$ , the log of the ratio between the variance of the gradients of PG without a baseline and PG with IS. The triangle represents the probability simplex with each corner representing a deterministic policy on a specific arm. The method written in blue (resp. red) in each figure has lower variance in blue (resp. red) regions of the simplex. The sampling policy $\mu$ , used in the PG method with IS, is a linear interpolation between $\pi$ and the uniform distribution, $\mu(a) = \frac{1}{2}\pi(a) + \frac{1}{6}$ . Note that this is not the min. variance sampling distribution and it leads to higher variance than PG without a baseline in some parts of the simplex. + +![](images/10d7e08b9f3fd8d41ea9e3b1942896ef1ad79f2b1cffb82b2af7f385ad3092fb.jpg) +(c) $b^{*}$ /IS. + +the uniform policy, $\mu (a) = (1 - \gamma)\pi (a) + \frac{\gamma}{K},\gamma \in (0,1]$ , where $K$ is the number of arms, we recover the classic EXP3 algorithm (Auer et al., 2002; Seldin et al., 2012). + +We can also confirm that this condition is not satisfied for the simple example we presented when discussing convergence to suboptimal policies. There, $p_t$ could decrease exponentially fast since the tails of the sigmoid function decay exponentially and the parameters move by at least a constant at every step. In this case, $\epsilon_t = \Omega(e^{-t})$ , resulting in $\lim_{t \to \infty} te^{-2t} = 0$ , so Proposition 3 does not apply. + +# 4.2. Importance sampling, baselines & variance + +As we have seen, using a separate behaviour policy that samples all actions sufficiently often may lead to stronger convergence guarantees, even if it increases the variance of the gradient estimates in most of the space, as what matters is what happens in the high variance regions, which are usually close to the boundaries. Fig. 3 shows the ratios of gradient variances between on-policy PG without baseline, on-policy PG with the minimum variance baseline, and off-policy PG using importance sampling (IS) where the sampling distribution is $\mu(a) = \frac{1}{2}\pi(a) + \frac{1}{6}$ , i.e., a mixture of the current policy $\pi$ and the uniform distribution. While using the minimum variance baseline decreases the variance on the entire space compared to not using a baseline, IS actually increases the variance when the current policy is close to uniform. However, IS does a much better job at reducing the variance close to the boundaries of the simplex, where it actually matters to guarantee convergence. + +This suggests that convergence of PG methods is not so much governed by the variance of the gradient estimates in general, but by the variance in the worst regions, usually near the boundary. While baselines can reduce the variance, they generally cannot prevent the variance in those regions from exploding, leading to the policy getting stuck. Thus, good baselines are not the ones reducing the variance across the space but rather those that can prevent the learning from reaching these regions altogether. Large values of $b$ , such that $r(a_i) - b$ is negative for most actions, achieve precisely that. On the other hand, due to the increased flexibility of sampling distributions, IS can limit the nefariousness of these critical regions, offering better convergence guarantees despite not reducing variance everywhere. + +Importantly, although IS is usually used in RL to correct for the distribution of past samples (e.g., Munos et al., 2016), we advocate here for expanding the research on designing appropriate sampling distributions as done by Hanna et al. (2017; 2018) and Parmas & Sugiyama (2019). This line of work has a long history in statistics (c.f., Liu, 2008). + +# 4.3. Other mitigating strategies + +We conclude this section by discussing alternative strategies to mitigate the convergence issues. While they might be effective, and some are indeed used in practice, they are not without pitfalls. + +First, one could consider reducing the stepsizes, with the hope that the policy would not converge as quickly towards a suboptimal deterministic policy and would eventually leave that bad region. Indeed, if we are to use vanilla PG in the two-arm bandit example, instead of NPG, this effectively reduces the stepsize by a factor of $\sigma(\theta)(1 - \sigma(\theta))$ (the Fisher information). In this case, we are able to show convergence in probability to the optimal policy. See Proposition 4 in Appendix B. + +Empirically, we find that, when using vanilla PG, the policy may still remain stuck near a suboptimal policy when using a negative baseline, similar to Fig. 2. While the previous proposition guarantees convergence eventually, the rate may be very slow, which remains problematic in practice. There is theoretical evidence that following even the true vanilla PG may result in slow convergence (Schaul et al., 2019), suggesting that the problem is not necessarily due to noise. + +An alternative solution would be to add entropy regularization to the objective. By doing so, the policy would be prevented from getting too close to deterministic policies. While this might prevent convergence to a suboptimal policy, it would also exclude the possibility of fully converging to the optimal policy, though the policy may remain near it. + +In bandits, EXP3 has been found not to enjoy high-probability guarantees on its regret so variants have been + +developed to address this deficiency (c.f. Lattimore & Szepesvári, 2020). For example, by introducing bias in the updates, their variance can be reduced significantly (Auer et al., 2002; Neu, 2015). Finally, other works have also developed provably convergent policy gradient algorithms using different mechanisms, such as exploration bonuses or ensembles of policies (Cai et al., 2019; Efroni et al., 2020; Agarwal et al., 2020). + +# 5. Extension to multi-step MDPs + +We focused our theoretical analyses on multi-arm bandits so far. However, we are also interested in more general environments where gradient-based methods are commonplace. We now turn our attention to the Markov Decision Process (MDP) framework (Puterman, 2014). An MDP is a set $\{S, A, P, r, \gamma, \rho\}$ where $S$ and $A$ are the set of states and actions, $P$ is the environment transition function, $r$ is the reward function, $\gamma \in [0,1)$ the discount factor, and $\rho$ is the initial state distribution. The goal of RL algorithms is to find a policy $\pi_{\theta}$ , parameterized by $\theta$ , which maximizes the (discounted) expected return; i.e. Eq. 1 becomes + +$$ +\arg \max _ {\theta} J (\theta) = \arg \max _ {\theta} \sum_ {s} d _ {\gamma} ^ {\pi_ {\theta}} (s) \sum_ {a} \pi_ {\theta} (a | s) r (s, a), +$$ + +where there is now a discounted distribution over states induced by $\pi_{\theta}$ . Although that distribution depends on $\pi_{\theta}$ in a potentially complex way, the parameter updates are similar to Eq. 2: + +$$ +\theta_ {t + 1} = \theta_ {t} + \frac {\alpha}{N} \sum_ {i} [ Q (s _ {i}, a _ {i}) - b (s _ {i}) ] \nabla_ {\theta} \log \pi_ {\theta} (a _ {i} | s _ {i}), +$$ + +where $(a_{i},s_{i})$ pairs are drawn according to the discounted state-visitation distribution induced by $\pi_{\theta}$ and $Q$ is the state-action value function induced by $\pi_{\theta}$ (c.f. Sutton & Barto, 2018). To match the bandit setting and common practice, we made the baseline state dependent. + +Although our theoretical analyses do not easily extend to multi-step MDPs, we empirically investigated if the similarity between these formulations leads to similar differences in learning dynamics when changing the baseline. We consider a $10 \times 10$ gridworld consisting of 4 rooms as depicted on Fig. 4a. We use a discount factor $\gamma = 0.99$ . The agent starts in the upper left room and two adjacent rooms contain a goal state of value 0.6 or 0.3. The best goal (even discounted), with a value of 1, lies in the furthest room, so that the agent must learn to cross the sub-optimal rooms and reach the furthest one. + +Similar to the bandit setting, for a state $s$ , we can derive the minimum-variance baseline $b^{*}(s)$ assuming access to state-action values $Q(s,a)$ for $\pi_{\theta}$ and consider perturbations to it. Again, we use baselines $b(s) = b^{*}(s) + \epsilon$ and $b(s) = b^{*}(s) -$ + +![](images/6a55f629b8fea33d51ad8fd8f351b020536c22790911acbd144ae52c0d114790.jpg) +(a) MDP + +![](images/62926f127fd7390676c3f49c1c95414bbcfef45b794b81a10b9147f71e1dfc9b.jpg) +(b) Returns + +![](images/95a6335fa55453661c1e8f62ed6ef4bba67e3ce0ec10198e2b2fc6aaabfb7678.jpg) +(c) Entropy (A) +Figure 4: We plot the discounted returns, the entropy of the policy over the states visited in each trajectory, and the entropy of the state visitation distribution, averaged over 50 runs, for multiple baselines. The baselines are of the form $b(s) = b^{*}(s) + \epsilon$ , perturbations of the minimum-variance baseline, with $\epsilon$ indicated in the legend. The shaded regions denote one standard error. Note that the policy entropy of lower baselines tends to decay faster than for larger baselines. Also, smaller baselines tend to get stuck on suboptimal policies, as indicated by the returns plot. See text for additional details. + +![](images/1562d06c86336075c40d39a597c226821c16f4f0967a2b4fdfb4e2a09ed2de5b.jpg) +(d) Entropy (S) + +$\epsilon$ , since they result in identical variances (this would not be the case if we used standard REINFORCE). We use a natural policy gradient estimate, which substitutes $\nabla \log \pi(a_i | s_i)$ by $F_{s_i}^{-1} \nabla \log \pi(a_i | s_i)$ in the update rule, where $F_{s_i}$ is the Fisher information matrix for state $s_i$ and solve for the exact $Q(s, a)$ values using dynamic programming for all updates (see Appendix D.6 for details). + +In order to identify the committal vs. non-committal behaviour of the agent depending on the baseline, we monitor the entropy of the policy and the entropy of the stationary state distribution over time. Fig.4b shows the average returns over time and Fig.4c and 4d show the entropy of the policy in two ways. The first is the average entropy of the action distribution along the states visited in each trajectory, and the second is the entropy of the distribution of the number of times each state is visited up to that point in training. + +The action entropy for smaller baselines tends to decay faster compared to larger ones, indicating convergence to a deterministic policy. This quick convergence is premature in some cases since the returns are not as high for the lower baselines. In fact for $\epsilon = -1$ , we see that the agent gets stuck on a policy that is unable to reach any goal within the time limit, as indicated by the returns of 0. On the other hand, the larger baselines tend to achieve larger returns with larger entropy policies, but do not fully converge to the optimal policy as evidenced by the gap in the returns plot. + +Since committal and non-committal behaviour can be directly inferred from the PG and the sign of the effective rewards $R(\tau) - b$ , we posit that these effects extend to all MDPs. In particular, in complex MDPs, the first trajectories explored are likely to be suboptimal and a low baseline will increase their probability of being sampled again, requiring the use of techniques such as entropy regularization to prevent the policy from getting stuck too quickly. In some preliminary experiments with a deep RL policy gradient al + +girthm, PPO (Schulman et al., 2017), where we perturb the baseline by a fixed constant, seem to indicate that negative perturbations perform slightly worse than positive perturbations. The results are not conclusive though and there are many confounding factors in this setting which could affect the outcome, including clipping due to PPO, neural network generalization, and adaptive optimizers. It is likely that a more careful strategy to perturb the baseline is needed to gain benefits, similar to using exploration bonuses. + +# 6. Conclusion + +We presented results that dispute common beliefs about baselines, variance, and policy gradient methods in general. As opposed to the common belief that baselines only provide benefits through variance reduction, we showed that they can significantly affect the optimization process in ways that cannot be explained by the variance and that lower variance can even sometimes be detrimental. + +Different baselines can give rise to very different learning dynamics, even when they reduce the variance of the gradients equally. They do that by either making a policy quickly tend towards a deterministic one (committal behaviour) or by maintaining high-entropy for a longer period of time (non-committal behaviour). We showed that committal behaviour can be problematic and lead to convergence to a suboptimal policy. Specifically, we showed that stochastic natural policy gradient does not always converge to the optimal solution due to the unusual situation in which the iterates converge to the optimal policy in expectation but not almost surely. Moreover, we showed that baselines that lead to lower-variance can sometimes be detrimental to optimization, highlighting the limitations of using variance to analyze the convergence properties of these methods. We also showed that standard convergence guarantees for PG methods do not apply to some settings because the assumption of bounded variance of the updates is violated. + +The aforementioned convergence issues are also caused by the problematic coupling between the algorithm's updates and its sampling distribution since one directly impacts the other. As a potential solution, we showed that off-policy sampling can sidestep these difficulties by ensuring we use a sampling distribution that is different than the one induced by the agent's current policy. This supports the hypothesis that on-policy learning can be problematic, as observed in previous work (Schaul et al., 2019; Hennes et al., 2020). Nevertheless, importance sampling in RL is generally seen as problematic (van Hasselt et al., 2018) due to instabilities it introduces to the learning process. Moving from an imposed policy, using past trajectories, to a chosen sampling policy reduces the variance of the gradients for near-deterministic policies and can lead to much better behaviour. In general, other variance-reduction strategies may also be more effective (Xu et al., 2019). + +More broadly, this work suggests that treating bandit and reinforcement learning problems as a black-box optimization of a function $J(\theta)$ may be insufficient to perform well. As we have seen, the current parameter value can affect all future parameter values by influencing the data collection process and thus the updates performed. Theoretically, relying on immediately available quantities such as the gradient variance and ignoring the sequential nature of the optimization problem is not enough to discriminate between certain optimization algorithms. In essence, to design highly-effective policy optimization algorithms, it may be necessary to develop a better understanding of how the optimization process evolves over many steps. + +# Acknowledgements + +We would like to thank Kris de Asis, Alan Chan, Ofir Nachum, Doina Precup, Dale Schuurmans, and Ahmed Touati for helpful discussions. We also thank Courtney Paquette, Vincent Liu, Scott Fujimoto and Csaba Szepesvári for reviewing an earlier version of this paper. Marlos C. Machado and Nicolas Le Roux are supported by a Canada CIFAR AI Chair. + +# References + +Agarwal, A., Kakade, S. M., Lee, J. D., and Mahajan, G. Optimality and approximation with policy gradient methods in markov decision processes. arXiv preprint arXiv:1908.00261, 2019. +Agarwal, A., Henaff, M., Kakade, S., and Sun, W. Pc-pg: Policy cover directed exploration for provable policy gradient learning. arXiv preprint arXiv:2007.08459, 2020. +Asadi, K. and Littman, M. L. An alternative softmax operator for reinforcement learning. In International Conference on Machine Learning, pp. 243-252. PMLR, 2017. +Auer, P., Cesa-Bianchi, N., Freund, Y., and Schapire, R. E. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48-77, 2002. +Bottou, L., Curtis, F. E., and Nocedal, J. Optimization methods for large-scale machine learning. Siam Review, 60(2):223-311, 2018. +Bubeck, S. and Cesa-Bianchi, N. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. arXiv preprint arXiv:1204.5721, 2012. +Cai, Q., Yang, Z., Jin, C., and Wang, Z. Provably efficient exploration in policy optimization. arXiv preprint arXiv:1912.05830, 2019. +Cheng, C.-A., Yan, X., and Boots, B. Trajectory-wise control variates for variance reduction in policy gradient methods. In Conference on Robot Learning, pp. 1379-1394, 2020. +De Boer, P.-T., Kroese, D. P., Mannor, S., and Rubinstein, R. Y. A tutorial on the cross-entropy method. Annals of operations research, 134(1):19-67, 2005. +Efroni, Y., Shani, L., Rosenberg, A., and Mannor, S. Optimistic policy optimization with bandit feedback. arXiv preprint arXiv:2002.08243, 2020. +Grathwohl, W., Choi, D., Wu, Y., Roeder, G., and Duvenaud, D. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. arXiv preprint arXiv:1711.00123, 2017. +Greensmith, E., Bartlett, P. L., and Baxter, J. Variance reduction techniques for gradient estimates in reinforcement learning. Journal of Machine Learning Research, 5(Nov): 1471-1530, 2004. +Gu, S., Lillicrap, T., Ghahramani, Z., Turner, R. E., and Levine, S. Q-prop: Sample-efficient policy gradient with an off-policy critic. arXiv preprint arXiv:1611.02247, 2016. + +Hanna, J. P., Thomas, P. S., Stone, P., and Niekum, S. Data-efficient policy evaluation through behavior policy search. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1394–1403. JMLR.org, 2017. +Hanna, J. P., Niekum, S., and Stone, P. Importance sampling policy evaluation with an estimated behavior policy. arXiv preprint arXiv:1806.01347, 2018. +Harper, M. and Weinstein, B. python-ternary: Ternary plots in python. Zenodo 10.5281/zenodo.594435, 2015. doi: 10.5281/zenodo.594435. URL https://github.com/marcharper/python-ternary. +Hennes, D., Morrill, D., Omidshafiei, S., Munos, R., Perolat, J., Lanctot, M., Gruslys, A., Lespiau, J.-B., Parmas, P., Duñez-Guzmán, E., et al. Neural replicator dynamics: Multiagent learning via hedging policy gradients. In Proceedings of the 19th International Conference on Autonomous Agents and MultiAgent Systems, pp. 492-501, 2020. +Hofmann, T., Lucchi, A., Lacoste-Julien, S., and McWilliams, B. Variance reduced stochastic gradient descent with neighbors. In Advances in Neural Information Processing Systems, pp. 2305-2313, 2015. +Kahn, H. and Harris, T. E. Estimation of particle transmission by random sampling. National Bureau of Standards applied mathematics series, 12:27-30, 1951. +Lattimore, T. and Szepesvári, C. Bandit Algorithms. Cambridge University Press, 2020. doi: 10.1017/9781108571401. +Liu, H., Feng, Y., Mao, Y., Zhou, D., Peng, J., and Liu, Q. Action-dependent control variates for policy optimization via stein's identity. arXiv preprint arXiv:1710.11198, 2017. +Liu, J. S. Monte Carlo strategies in scientific computing. Springer Science & Business Media, 2008. +Mei, J., Xiao, C., Dai, B., Li, L., Szepesvári, C., and Schuurmans, D. Escaping the gravitational pull of softmax. Advances in Neural Information Processing Systems, 33, 2020a. +Mei, J., Xiao, C., Szepesvari, C., and Schuurmans, D. On the global convergence rates of softmax policy gradient methods. In International Conference on Machine Learning, pp. 6820-6829. PMLR, 2020b. +Munos, R., Stepleton, T., Harutyunyan, A., and Bellemare, M. G. Safe and efficient off-policy reinforcement learning. In Advances in Neural Information Processing Systems, pp. 1046-1054, 2016. + +Neu, G. Explore no more: Improved high-probability regret bounds for non-stochastic bandits. arXiv preprint arXiv:1506.03271, 2015. +Parmas, P. and Sugiyama, M. A unified view of likelihood ratio and reparameterization gradients and an optimal importance sampling scheme. arXiv preprint arXiv:1910.06419, 2019. +Peters, J. and Schaal, S. Reinforcement learning of motor skills with policy gradients. *Neural networks*, 21(4):682-697, 2008. +Precup, D. Eligibility traces for off-policy policy evaluation. Computer Science Department Faculty Publication Series, pp. 80, 2000. +Puterman, M. L. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014. +Robbins, H. Some aspects of the sequential design of experiments. Bulletin of the American Mathematical Society, 58(5):527-535, 1952. +Schaul, T., Borsa, D., Modayil, J., and Pascanu, R. Ray interference: a source of plateaus in deep reinforcement learning. arXiv preprint arXiv:1904.11455, 2019. +Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. +Seldin, Y., Szepesvári, C., Auer, P., and Abbasi-Yadkori, Y. Evaluation and analysis of the performance of the exp3 algorithm in stochastic environments. In EWRL, pp. 103-116, 2012. +Seldin, Y., Szepesvári, C., Auer, P., and Abbasi-Yadkori, Y. Evaluation and analysis of the performance of the exp3 algorithm in stochastic environments. In European Workshop on Reinforcement Learning, pp. 103-116. PMLR, 2013. +Sutton, R. S. and Barto, A. G. Reinforcement Learning: An Introduction. MIT Press, 2 edition, 2018. +van Hasselt, H., Doron, Y., Strub, F., Hessel, M., Sonnerat, N., and Modayil, J. Deep reinforcement learning and the deadly triad. CoRR, abs/1812.02648, 2018. +Williams, R. J. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992. +Wu, C., Rajeswaran, A., Duan, Y., Kumar, V., Bayen, A. M., Kakade, S., Mordatch, I., and Abbeel, P. Variance reduction for policy gradient with action-dependent factorized baselines. arXiv preprint arXiv:1803.07246, 2018. + +Xu, P., Gao, F., and Gu, Q. Sample efficient policy gradient methods with recursive variance reduction. arXiv preprint arXiv:1909.08610, 2019. \ No newline at end of file diff --git a/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/images.zip b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d925304519e5bde845aa7cf00eda254e77939e2e --- /dev/null +++ b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bec378fb710a99e2c72030e510d6e44569cadba98c9458def54b55b0c8e07fbc +size 177024 diff --git a/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/layout.json b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2a9018cc297f381bb977053e4a5d4b0e88d1d470 --- /dev/null +++ b/beyondvariancereductionunderstandingthetrueimpactofbaselinesonpolicyoptimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a05b1f952f4023b6b6f5e27457d3f66766439a9f5b21dd094be99950e5e0863d +size 497866 diff --git a/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_content_list.json b/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c80a6f88f53fd8b297a16f6b8f361d9b6f81a6b7 --- /dev/null +++ b/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea67a7a1f2fd1594d9258f86415ad96457389b6a25f00614cdbd7b83b48cc973 +size 89721 diff --git a/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_model.json b/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..84e7e6c1a2ea21271511ba7952802a629d18c5d9 --- /dev/null +++ b/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fc35b58e066a736b5f1fbb89dbac86866091256d62bf2bdc43202d7536abadc +size 105706 diff --git a/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_origin.pdf b/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a0a71619f4d1708299392c7ba2c8da972029f43 --- /dev/null +++ b/biasfreescalablegaussianprocessesviarandomizedtruncations/96d3ce24-1450-4ef0-a197-506d6a84ceaa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc191f44eb14d62a314750194fdcf81630cd8e36549b390a38586a9e45a33d6a +size 1149174 diff --git a/biasfreescalablegaussianprocessesviarandomizedtruncations/full.md b/biasfreescalablegaussianprocessesviarandomizedtruncations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6cd85c7ed28116279c40743e299de7fe8f2e65ec --- /dev/null +++ b/biasfreescalablegaussianprocessesviarandomizedtruncations/full.md @@ -0,0 +1,407 @@ +Andres Potapczynski $^{*1}$ Luhuan Wu $^{*2}$ Dan Biderman $^{*1}$ Geoff Pleiss $^{1}$ John P. Cunningham $^{1,2}$ + +# Abstract + +Scalable Gaussian Process methods are computationally attractive, yet introduce modeling biases that require rigorous study. This paper analyzes two common techniques: early truncated conjugate gradients (CG) and random Fourier features (RFF). We find that both methods introduce a systematic bias on the learned hyperparameters: CG tends to underfit while RFF tends to overfit. We address these issues using randomized truncation estimators that eliminate bias in exchange for increased variance. In the case of RFF, we show that the bias-to-variance conversion is indeed a trade-off: the additional variance proves detrimental to optimization. However, in the case of CG, our unbiased learning procedure meaningfully outperforms its biased counterpart with minimal additional computation. Our code is available at https://github.com/cunningham-lab/RTGPS. + +# 1. Introduction + +Gaussian Processes (GP) are popular and expressive nonparametric models, and considerable effort has gone into alleviating their cubic runtime complexity. Notable successes include inducing point methods (e.g. Snelson & Ghahramani, 2006; Titsias, 2009; Hensman et al., 2013), finite-basis expansions (e.g. Rahimi & Recht, 2008; Mutny & Krause, 2018; Wilson et al., 2020; Loper et al., 2020), nearest neighbor truncations (e.g. Datta et al., 2016; Katzfuss et al., 2021), and iterative numerical methods (e.g. Cunningham et al., 2008; Cutajar et al., 2016; Gardner et al., 2018). Common to these techniques is the classic speed-bias tradeoff: coarser GP approximations afford faster but more biased solutions that in turn affect both the model's predictions and learned hyperparameters. While a few papers analyze the + +*Equal contribution (randomly ordered). 1Zuckerman Institute, Columbia University 2Statistics Department, Columbia University. Correspondence to: Andres Potapczynski , Luhuan Wu , Dan Biderman . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +bias of inducing point methods (Bauer et al., 2016; Burt et al., 2019), the biases of other approximation techniques, and their subsequent impact on learned GP models, have not been rigorously studied. + +Here we scrutinize the biases of two popular techniques – random Fourier features (RFF) (Rahimi & Recht, 2008) and conjugate gradients (CG) (e.g. Cunningham et al., 2008; Cutajar et al., 2016; Gardner et al., 2018). These methods are notable due to their popularity and because they allow dynamic control of the speed-bias tradeoff: at any model evaluation, the user can adjust the number of CG iterations or RFF features to a desired level of approximation accuracy. In practice, it is common to truncate these methods to a fixed number of iterations/features that is deemed adequate. However, such truncation will stop short of an exact (machine precision) solution and potentially lead to biased optimization outcomes. + +We provide a novel theoretical analysis of the biases resulting from RFF and CG on the GP log marginal likelihood objective. Specifically, we prove that CG is biased towards hyperparameters that underfit the data, while RFF is biased towards overfitting. In addition to yielding suboptimal hyperparameters, these biases hurt posterior predictions, regardless of the inference method used at test-time. Perhaps surprisingly, this effect is not subtle, as we will demonstrate. Our analysis suggests there is value in debiasing GP learning with CG and RFF. To do so, we turn to recent work that shows the merits of exchanging the speed-bias tradeoff for a speed-variance tradeoff (Beatson & Adams, 2019; Chen et al., 2019; Luo et al., 2020; Oktay et al., 2020). These works all introduce a randomization procedure that reweights elements of a fast truncated estimator, eliminating its bias at the cost of increasing its variance. + +We thus develop bias-free versions of GP learning with CG and RFF using randomized truncation estimators. In short, we randomly truncate the number of CG iterations and RFF features, while reweighting intermediate solutions to maintain unbiasedness. Our variant of CG uses the Russian Roulette estimator (Kahn, 1955), while our variant of RFF uses the Single Sample estimator of Lyne et al. (2015). We believe our RR-CG and SS-RFF methods to be the first to produce unbiased estimators of the GP log marginal likelihood with $< \mathcal{O}(N^3)$ computation. + +Finally, through extensive empirical evaluation, we find our methods and their biased counterparts indeed constitute a bias-variance tradeoff. Both RR-CG and SS-RFF are unbiased, recovering nearly the same optimum as the exact GP method, while GP trained with CG and RFF often converge to solutions with worse likelihood. We note that bias elimination is not always practical. For SS-RFF, the optimization is slow, due to the large auxiliary variance needed to counteract the slowly decaying bias of RFF. On the other hand, RR-CG incurs a minimal variance penalty, likely due to the favorable convergence properties of CG. In a wide range of benchmark datasets, RR-CG demonstrates similar or better predictive performance compared to CG using the same expected computational time. + +To summarize, this work offers three main contributions: + +- theoretical analysis of the bias of CG- and RFF-based GP approximation methods (§3) +- RR-CG and SS-RFF: bias-free versions of these popular GP approximation methods (§4) +- results demonstrating the value of our RR-CG and SS-RFF methods ( $\S 3$ and 5). + +# 2. Background + +We consider observed data $\mathcal{D} = \{(\mathbf{x}_i, y_i)\}_{i=1}^N$ for $\mathbf{x}_i \in \mathbb{R}^d$ and $y_i \in \mathbb{R}$ , and the standard GP model: + +$$ +\begin{array}{l} f (\cdot) \sim \mathcal {G P} (\mu (\cdot), k (\cdot , \cdot)), \\ \mathbf {y} _ {i} = f (\mathbf {x} _ {i}) + \epsilon_ {i}, \quad \epsilon_ {i} \sim \mathcal {N} \left(0, \sigma^ {2}\right) \\ \end{array} +$$ + +where $k(\cdot, \cdot)$ is the covariance kernel, $\mu(\cdot)$ is set to zero without loss of generality, and hyperparameters are collected into the vector $\theta$ , which is optimized as: + +$$ +\begin{array}{l} \boldsymbol {\theta} ^ {*} = \arg \min _ {\boldsymbol {\theta}} \mathcal {L} (\boldsymbol {\theta}) \\ \mathcal {L} (\boldsymbol {\theta}) = - \log p (\mathbf {y} \mid \mathbf {X}; \boldsymbol {\theta}) (1) \\ = \frac {1}{2} \left(\underbrace {\log | \widehat {\mathbf {K}} _ {\mathbf {X X}} |} _ {\text {m o d e l c o m p l e x i t y}} + \underbrace {\mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y}} _ {\text {d a t a f i t}} + N \log 2 \pi\right) (1) \\ \end{array} +$$ + +where $\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}\in \mathbb{R}^{N\times N}$ is the Gram matrix of all data points with diagonal observational noise: + +$$ +\widehat {\mathbf {K}} _ {\mathbf {X X}} [ i, j ] = k (\mathbf {x} _ {i}, \mathbf {x} _ {j}) + \sigma^ {2} \mathbb {I} _ {i = j}. +$$ + +Following standard practice, we optimize $\theta$ with gradients: + +$$ +\frac {\partial \mathcal {L}}{\partial \boldsymbol {\theta}} = \frac {1}{2} \left(\operatorname {t r} \left\{\widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \frac {\partial \widehat {\mathbf {K}} _ {\mathbf {X X}}}{\partial \boldsymbol {\theta}} \right\} - \mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \frac {\partial \widehat {\mathbf {K}} _ {\mathbf {X X}}}{\partial \boldsymbol {\theta}} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y}\right). \tag {2} +$$ + +Three terms thus dominate the computational complexity: $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y},\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ , and $\operatorname {tr}\{\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\frac{\partial\widehat{\mathbf{K}}_{\mathbf{XX}}}{\partial\theta}\}$ . The common + +approach to computing this triad is the Cholesky factorization, requiring $\mathcal{O}(N^3)$ time and $\mathcal{O}(N^2)$ space. + +Extensive literature has accelerated the inference and hyperparameter learning of GP. Two very popular strategies are using conjugate gradients (Cunningham et al., 2008; Cutajar et al., 2016; Gardner et al., 2018; Wang et al., 2019) to approximate the linear solves in Eq. (2), and random Fourier features (Rahimi & Recht, 2008), which constructs a randomized finite-basis approximation of the kernel. + +# 2.1. Conjugate Gradients + +To apply conjugate gradients to GP learning, we begin by replacing the gradient in Eq. (2) with a stochastic estimate (Cutajar et al., 2016; Gardner et al., 2018): + +$$ +\frac {\partial \mathcal {L}}{\partial \boldsymbol {\theta}} \approx \frac {1}{2} \left(\mathbf {z} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \frac {\partial \widehat {\mathbf {K}} _ {\mathbf {X X}}}{\partial \boldsymbol {\theta}} \mathbf {z} - \mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \frac {\partial \widehat {\mathbf {K}} _ {\mathbf {X X}}}{\partial \boldsymbol {\theta}} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y}\right), \tag {3} +$$ + +where $\mathbf{z}$ is a random variable such that $\mathbb{E}[\mathbf{z}] = 0$ and $\mathbb{E}[\mathbf{z}\mathbf{z}^T] = \mathbf{I}$ . Note that the first term constitutes a stochastic estimate of the trace term (Hutchinson, 1989). Thus, stochastic optimization of Eq. (1) can be reduced to computing the linear solves $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{z}$ . + +Conjugate gradients (CG) (Hestenes et al., 1952) is an iterative algorithm for solving positive definite linear systems $\mathbf{A}^{-1}\mathbf{b}$ . It consists of a three-term recurrence, where each new term requires only a matrix-vector multiplication with $\mathbf{A}$ . More formally, each CG iteration computes a new term of the following summation: + +$$ +\mathbf {A} ^ {- 1} \mathbf {b} = \sum_ {i = 1} ^ {N} \gamma_ {i} \mathbf {d} _ {i}, \tag {4} +$$ + +where the $\gamma_{i}$ are coefficients and the $\mathbf{d}_i$ are conjugate search directions (Golub & Van Loan, 2012). $N$ iterations of CG produce all $N$ summation terms and recover the exact solution. In practice, exact convergence may require more than $N$ iterations due to inaccuracies of floating point arithmetic. However, the summation converges exponentially, and so $J \ll N$ iterations may suffice to achieve high accuracy. + +CG is an appealing method for computing $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{z}$ due to its computational complexity and its potential for GPU-accelerated matrix products. $J$ iterations takes at most $\mathcal{O}(JN^2)$ time and $\mathcal{O}(N)$ space if the matrix-vector products are performed in a map-reduce fashion (Wang et al., 2019). However, ill-conditioned kernel matrices hinder the convergence rate (Cutajar et al., 2016), and so the $J^{\mathrm{th}}$ CG iteration may yield an inaccurate approximation of Eq. (3). + +# 2.2. Random Fourier Features + +Rahimi & Recht (2008) introduce a randomized finite-basis approximation to stationary kernels: + +$$ +k \left(\mathbf {x}, \mathbf {x} ^ {\prime}\right) = k \left(\mathbf {x} - \mathbf {x} ^ {\prime}\right) \approx \phi (\mathbf {x}) ^ {\top} \phi \left(\mathbf {x} ^ {\prime}\right) \tag {5} +$$ + +where $\phi (\mathbf{x})\in \mathbb{R}^{J}$ and $J\ll N$ . The RFF approximation relies on Bochner's theorem (Bochner et al., 1959): letting $\tau = \mathbf{x} - \mathbf{x}'$ , all stationary kernels $k(\tau)$ on $\mathbb{R}^d$ can be exactly expressed as the Fourier dual of a nonnegative measure $\mathbb{P}(\omega)\colon k(\tau) = \int \mathbb{P}(\omega)\exp (i\omega \tau)d\omega$ . A Monte Carlo approximation of this Fourier transform yields: + +$$ +k (\tau) \approx \frac {2}{J} \sum_ {j = 1} ^ {J / 2} \exp (i \omega_ {j} \tau), \quad \omega_ {j} \sim \mathbb {P} (\boldsymbol {\omega}), +$$ + +which simplifies to a finite-basis approximation: + +$$ +\mathbf {K} _ {\mathbf {X X}} \approx [ \phi (\mathbf {x} _ {1}) \dots \phi (\mathbf {x} _ {n}) ] [ \phi (\mathbf {x} _ {1}) \dots \phi (\mathbf {x} _ {n}) ] ^ {\top}, +$$ + +$$ +\boldsymbol {\phi} (\mathbf {x}) = [ \cos (\boldsymbol {\omega} _ {i} ^ {\top} \mathbf {x}), \sin (\boldsymbol {\omega} _ {i} ^ {\top} \mathbf {x}) ] _ {i = 1} ^ {J / 2}, \quad \boldsymbol {\omega} _ {i} \sim \mathbb {P} (\boldsymbol {\omega}). +$$ + +For many common kernels, $\mathbb{P}(\omega)$ can be computed in closed-form (e.g. RBF kernels have zero-mean Gaussian spectral densities). The approximated log likelihood can be computed in $\mathcal{O}(J^3 + N)$ time and $\mathcal{O}(JN)$ space using the Woodbury inversion lemma and the matrix determinant lemma, respectively. The number of random features $J/2$ is a user choice, with typical values between 100-1000. More features lead to more accurate kernel approximations. + +# 2.3. Unbiased Randomized Truncation + +We will now briefly introduce Randomized Truncation Estimators, which are the primary tool we use to unbias the CG and RFF log marginal likelihood estimates. At a high level, assume that we wish to estimate some quantity $\psi$ that can be expressed as a (potentially-infinite) series: + +$$ +\psi = \sum_ {j = 1} ^ {H} \Delta_ {j}, \quad H \in \mathbb {N} \cup \{\infty \}. +$$ + +Here and in the following sections, $\Delta_j$ can either be random or deterministic. To avoid the expensive evaluation of the full summation, a randomized truncation estimator chooses a random term $J \in \{1, \dots, H\}$ with probability mass function $\mathbb{P}(J) = \mathbb{P}(\mathcal{I} = J)$ after which to truncate computation. In the following, we introduce two means of deriving unbiased estimators by weighting the summation terms. + +The Russian Roulette estimator (Kahn, 1955) obtains an unbiased estimator $\bar{\psi}_J$ by truncating the sum after $J \sim \mathbb{P}(J)$ terms and dividing the surviving terms by their survival probabilities: + +$$ +\bar {\psi} _ {J} = \sum_ {j = 1} ^ {J} \frac {\Delta_ {j}}{\mathbb {P} (\mathcal {J} \geq j)} = \sum_ {j = 1} ^ {H} \left(\frac {\mathbb {I} _ {J \geq j}}{\mathbb {P} (\mathcal {J} \geq j)}\right) \Delta_ {j}, \tag {6} +$$ + +and, $\mathbb{E}[\bar{\psi}_J] = \sum_{i=1}^{H} \Delta_j = \psi$ . (See appendix for further derivation.) The choice of $\mathbb{P}(J)$ determines both the computational efficiency and the variance of $\bar{\psi}_J$ . A thin-tailed $\mathbb{P}(J)$ will often truncate sums after only a few terms ( $J \ll H$ ). + +However, tail events $(J\approx H)$ are upweighted inversely to their low survival probability, and so thin-tailed truncation distributions may lead to high variance. + +The Single Sample estimator (Lyne et al., 2015) implements an alternative reweighting scheme. After drawing $J \sim \mathbb{P}(J)$ , it computes a single summation term $\Delta_J$ , which it upweights by $1 / \mathbb{P}(J)$ : + +$$ +\bar {\psi} _ {J} = \frac {\Delta_ {J}}{\mathbb {P} (J)} = \sum_ {j = 1} ^ {H} \left(\frac {\mathbb {I} _ {J = j}}{\mathbb {P} (\mathcal {I} = j)}\right) \Delta_ {j}. \tag {7} +$$ + +This procedure is unbiased, and it amounts to estimating $\psi$ using a single importance-weighted sample from $\mathbb{P}(J)$ (see appendix). Again, $\mathbb{P}(J)$ controls the speed/variance trade-off. We refer the reader to (Beatson & Adams, 2019) for a detailed comparison of these two estimators. We emphasize that both estimators remain unbiased even if $\Delta_j$ is a random variable, as long as it is independent from the random truncation integer $J$ . + +# 3. GP Learning with CG and RFF is Biased + +Here we prove that early truncated CG and RFF provide biased approximations to the terms comprising the GP log marginal likelihood (Eq. 1). We also derive the bias decay rates for each method. We then empirically demonstrate these biases and show they affect the hyperparameters learned through optimization. Remarkably, we find that the above biases are highly systematic: CG-based GP learning favors underfitting hyperparameters while RFF-based learning favors overfitting hyperparameters. + +# 3.1. CG Biases GP Towards Underfitting + +In the GP literature, CG has often been considered an "exact" method for computing the log marginal likelihood (Cunningham et al., 2008; Cutajar et al., 2016), as the iterations are only truncated after reaching a pre-specified residual error threshold (e.g. $10^{-10}$ ). However, as CG is applied to ever-larger kernel matrices it is common to truncate the CG iterations before reaching this convergence (Wang et al., 2019). While this accelerates the hyperparameter learning process, the resulting solves and gradients can no longer be considered "exact." In what follows, we show that the early-truncated CG optimization objective is not only approximate but also systematically biased towards underfitting. + +To analyze the early-truncation bias, we adopt the analysis of Gardner et al. (2018) that recovers the GP log marginal likelihood (Eq. 1) from the stochastic gradient's CG estimates of $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{z}$ (Eq. 3). Recall the two terms in the log marginal likelihood are the "data fit" term $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and the "model complexity" term $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ . The first term falls directly out of the CG estimate of $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ , while a + +![](images/0143de43fb602592c899a0160ce8af6446173cff05534122875306913105d3e9.jpg) +Figure 1. CG (left) systematically overestimates log $|\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}|$ and underestimates $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{y}$ whereas RFF (right) does the opposite. The dashed orange line shows the exact values computed by Cholesky. Our unbiased methods, RR-CG (left) and SS-RFF (right), recover the true log $|\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}|$ and $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{y}$ values. For these two methods, the $x$ -axis indicates the expected number of iterations/features. + +![](images/0d1fb09db399153f017bad5c70d68ef299a13b0938b9cbc4edab4a3b45f93089.jpg) + +![](images/456be6156675b672f167df15534c6faf6145667e680ff03656a01ac36bbec8d8.jpg) +Figure 2. Kernel lengthscale values learned by optimizing (biased) CG and RFF log marginal likelihood approximations. CG overestimates the optimal kernel lengthscale whereas RFF underestimates it. We plot the divergence (in log-ratio scale) between the learned and true lengthscales as a function of the number of CG iterations (left) and of the number of RFF samples (right). + +stochastic estimate of $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ can be obtained through the byproducts of CG's computation for $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{z}$ . Gardner et al. (2018) show that the CG coefficients in Eq. (4) can be manipulated to produce a partial tridiagonalization: $\mathbf{T}_{\mathbf{z}}^{(J)} = \mathbf{Q}_{\mathbf{z}}^{(J)\top}\widehat{\mathbf{K}}_{\mathbf{XX}}\mathbf{Q}_{\mathbf{z}}^{(J)}$ , where $\mathbf{T}_{\mathbf{z}}^{(J)} \in \mathbb{R}^{J \times J}$ is tridiagonal. $\mathbf{T}_{\mathbf{z}}^{(J)}$ can compute the Stochastic Lanczos Quadrature estimate of $\widehat{\mathbf{K}}_{\mathbf{XX}}$ (Ubaru et al., 2017; Dong et al., 2017): + +$$ +\begin{array}{l} \log | \widehat {\mathbf {K}} _ {\mathbf {X X}} | = \mathbb {E} \left[ \mathbf {z} ^ {T} (\log \widehat {\mathbf {K}} _ {\mathbf {X X}}) \mathbf {z} \right] \\ \approx \left\| \mathbf {z} \right\| ^ {2} \mathbf {e} _ {1} ^ {\top} \left(\log \mathbf {T} _ {\mathbf {z}} ^ {(J)}\right) \mathbf {e} _ {1}, \tag {8} \\ \end{array} +$$ + +where $\log (\cdot)$ is the matrix logarithm and $\mathbf{e}_1$ is the first row of the identity matrix. The following theorem analyzes the bias of these $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{y}$ and $\log |\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}|$ estimates: + +Theorem 1. Let $u_{J}$ and $v_{J}$ be the estimates of $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{y}$ and $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ respectively after $J$ iterations of CG; i.e.: + +$$ +u _ {J} = \mathbf {y} ^ {\top} \left(\sum_ {i = 1} ^ {J} \gamma_ {i} \mathbf {d} _ {i}\right), v _ {J} = \| \mathbf {z} \| ^ {2} \mathbf {e} _ {1} ^ {\top} \left(\log \mathbf {T} _ {\mathbf {z}} ^ {(J)}\right) \mathbf {e} _ {1}. +$$ + +If $J < N$ , CG underestimates the inverse quadratic term and overestimates the log determinant in expectation: + +$$ +u _ {J} \leq \mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y}, \quad \mathbb {E} _ {\mathbf {z}} [ v _ {J} ] \geq \log | \widehat {\mathbf {K}} _ {\mathbf {X X}} |. \tag {9} +$$ + +The biases of both terms decay at a rate of $\mathcal{O}(C^{-2J})$ , where $C$ is a constant that depends on the conditioning of $\widehat{\mathbf{K}}_{\mathbf{XX}}$ . + +Proof sketch. The direction of the biases can be proved using a connection between CG and numeric quadrature. $u_{J}$ and $v_{J}$ are exactly equal to the $J$ -point Gauss quadrature approximation of $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\| \mathbf{z}\|^{2}\mathbf{e}_{1}^{\top}(\log \mathbf{T}_{\mathbf{z}}^{(N)})\mathbf{e}_{1}$ represented as Riemann-Stieltjes integrals. The sign of the CG approximation bias follows from the standard Gauss quadrature error bound, which is negative for $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and positive for $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ . The convergence rates are from standard bounds on CG (Golub & Van Loan, 2012) and the analysis of Ubaru et al. (2017). See appendix for a full proof. + +Fig. 1 confirms our theoretical analysis and demonstrates the systematic biases of CG. We plot the log marginal likelihood terms for a subset of the PoleTele UCI dataset, varying the number of CG iterations $(J)$ used to produce the estimates. Compared against the exact terms (computed with Cholesky), we see an overestimation of $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ and an underestimation of $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ . These biases are most prominent when using few CG iterations. + +We turn to study the effect of CG learning on hyperparameters. Since the log marginal likelihood is a nonconvex function of $\theta$ , it is not possible to directly prove how the bias affects $\theta$ . Nevertheless, we know intuitively that underestimating $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{y}$ de-prioritizes model fit while overestimating $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ over-penalizes model complexity. Thus, the learned hyperparameters will likely underfit the data. Underfitting may manifest in an overestimation of the learned lengthscale $\ell$ , as low values of $\ell$ increase the flexibility and the complexity of the model. This hypothesis is empirically confirmed in Fig. 2 (left panel). We train a GP regression model on a toy dataset: $y = x\sin (5\pi x) + \varepsilon$ + +and $\varepsilon \sim \mathcal{N}(0,0.01)$ . We fix all hyperparameters other than the lengthscale, which is learned using both CG-based optimization and (exact) Cholesky-based optimization. The overestimation of $\ell$ decays with the number of CG iterations. + +# 3.2. RFF Biases GP Towards Overfitting + +Previous work has studied the accuracy of RFF's approximation to the entries of the Gram matrix $k(\mathbf{x},\mathbf{x}^{\prime}) \approx \phi (\mathbf{x})^{\top}\phi (\mathbf{x}^{\prime})$ (Rahimi & Recht, 2008; Sutherland & Schneider, 2015). However, to the best of our knowledge there has been little analysis of nonlinear functions of this approximate Gram matrix, such as $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ appearing in the GP objective. Interestingly, we find that RFF systematically biases these terms: + +Theorem 2. Let $\widetilde{\mathbf{K}}_J$ be the RFF approximation with $J/2$ random features. In expectation, $\widetilde{\mathbf{K}}_J$ overestimates the inverse quadratic and underestimates the log determinant: + +$$ +\mathbb {E} _ {\mathbb {P} (\omega)} \left[ \mathbf {y} ^ {\top} \widetilde {\mathbf {K}} _ {J} ^ {- 1} \mathbf {y} \right] \geq \mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y} \tag {10} +$$ + +$$ +\mathbb {E} _ {\mathbb {P} (\boldsymbol {\omega})} \left[ \log | \widetilde {\mathbf {K}} _ {J} | \right] \leq \log | \widehat {\mathbf {K}} _ {\mathbf {X X}} |. \tag {11} +$$ + +The biases of both terms decay at a rate of $\mathcal{O}(1 / J)$ + +Proof sketch. The direction of the biases is a straightforward application of Jensen's inequality, noting that $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}$ is a convex function and $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ is a concave function. The magnitude of the bias is derived from a second-order Taylor expansion that closely resembles the analysis of Nowozin (2018). See appendix for full proof. + +Again, Fig. 1 confirms the systematic biases of RFF, which decay at a rate proportional to the number of features, as predicted by Thm. 2. Hence, RFF should affect the learned hyperparameters in a manner opposite to CG. Overestimating $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ emphasizes data fitting while underestimating $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ reduces the model complexity penalty, overall resulting in overfitting behavior. Following the intuition presented in Sec. 3.1, we expect the lengthscale to be underestimated, as empirically confirmed by Fig. 2 (right panel). The figure also illustrates the slow decay of the RFF bias. + +# 4. Bias-free Scalable Gaussian Processes + +We debias the estimates of both the GP training objective in Eq. (1) and its gradient in Eq. (2) (as approximated by CG and RFF) using unbiased randomized truncation estimators. To see how such estimators apply to GP hyperparameter learning, we note that both CG and RFF recover the true log marginal likelihood (or an unbiased estimate thereof) in their limits: + +Observation 1. CG recovers the exact log marginal likeli + +hood in expectation in at most $N$ iterations: + +$$ +\mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y} = \mathbf {y} ^ {\top} \left(\sum_ {j = 1} ^ {N} \gamma_ {j} \mathbf {d} _ {j}\right), \tag {12} +$$ + +$$ +\log | \widehat {\mathbf {K}} _ {\mathbf {X X}} | = \mathbb {E} _ {\mathbf {z}} \left[ \| \mathbf {z} \| ^ {2} \mathbf {e} _ {1} ^ {\top} \left(\log \mathbf {T} _ {\mathbf {z}} ^ {(N)}\right) \mathbf {e} _ {1} \right]. \tag {13} +$$ + +By the law of large numbers, RFF converges almost surely to the exact log marginal likelihood as the number of random features goes to infinity: + +$$ +\mathbf {y} ^ {\top} \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y} = \lim _ {J \rightarrow \infty} \mathbf {y} ^ {\top} \widetilde {\mathbf {K}} _ {J} ^ {- 1} \mathbf {y}, \tag {14} +$$ + +$$ +\log | \widehat {\mathbf {K}} _ {\mathbf {X X}} | = \lim _ {J \rightarrow \infty} \log | \widetilde {\mathbf {K}} _ {J} |. \tag {15} +$$ + +To maintain the scalability of CG and RFFs while eliminating bias, we express the log marginal likelihood terms in Eqs. (12) to (15) as summations amenable to randomized truncation. We then apply the Russian Roulette and Single Sample estimators of Sec. 2.3 to avoid computing all summation terms while obtaining the same result in expectation. + +# 4.1. Russian Jouette-Truncated CG (RR-CG) + +The stochastic gradient in Eq. (3) requires performing two solves: $\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{y}$ and $\widehat{\mathbf{K}}_{\mathbf{X}\mathbf{X}}^{-1}\mathbf{z}$ . Using the summation formulation of CG (Eq. 4), we can write these two solves as series: + +$$ +\widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y} = \sum_ {i = 1} ^ {N} \gamma_ {i} \mathbf {d} _ {i}, \quad \widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {z} = \sum_ {i = 1} ^ {N} \gamma_ {i} ^ {\prime} \mathbf {d} _ {i} ^ {\prime}, +$$ + +where each CG iteration computes a new term of the summation. By applying the Russian Roulette estimator from Eq. (6), we obtain the following unbiased estimates: + +$$ +\widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {y} \approx \sum_ {j = 1} ^ {J} \left(\gamma_ {j} \mathbf {d} _ {j}\right) / \mathbb {P} (\mathcal {J} \geq j), \quad J \sim \mathbb {P} (J) \tag {16} +$$ + +$$ +\widehat {\mathbf {K}} _ {\mathbf {X X}} ^ {- 1} \mathbf {z} \approx \sum_ {j = 1} ^ {J ^ {\prime}} (\gamma_ {j} ^ {\prime} \mathbf {d} _ {j} ^ {\prime}) / \mathbb {P} (\mathcal {J} \geq j). J ^ {\prime} \sim \mathbb {P} (J ^ {\prime}), +$$ + +These unbiased solves produce an unbiased optimization gradient in Eq. (3); we refer to this approach as Russian Roulette CG (RR-CG). With the appropriate truncation distribution $\mathbb{P}(J)$ , this estimate affords the same computational complexity of standard CG without its bias. + +We must compute two independent estimates of $\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ with different $J\sim \mathbb{P}(J)$ in order for the $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\frac{\partial\widehat{\mathbf{K}}_{\mathbf{XX}}}{\partial\theta}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ term in Eq. (3) to be unbiased. Thus, the unbiased gradient requires 3 calls to RR-CG, as opposed to the 2 CG calls needed for the biased gradient. Nevertheless, RR-CG has the same $\mathcal{O}(JN^2)$ complexity as standard CG - and the additional solve can be computed in parallel with the others. + +We can also use the Russian Roulette estimator to compute the log marginal likelihood itself, though this is not strictly necessary for gradient-based optimization. (See appendix.) + +Choosing the truncation distribution. Since the Russian Roulette estimator is unbiased for any choice of $\mathbb{P}(J)$ + +we wish to choose a truncation distribution that balances computational cost and variance1. Beatson & Adams (2019) propose the relative optimization efficiency (ROE) metric, which is the ratio of the expected improvement of taking an optimization step with our gradient estimate to its computational cost. A critical requirement of the ROE analysis is the expected rate of decay of our approximations in terms of the number of CG iterations $J$ . We summarize our estimates and choices of distribution as follows: + +Theorem 3. The approximation to $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ and to $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ using RR-CG decays at a rate of $\mathcal{O}(C^{-2J})$ . Therefore the truncation distribution that maximizes the ROE is $\mathbb{P}^{*}(J)\propto C^{-2J}$ , where $C$ is a constant that depends on the conditioning of $\widehat{\mathbf{K}}_{\mathbf{XX}}$ . The expected computation and variance of $\mathbb{P}^{*}(J)$ is finite. + +Proof sketch. Beatson & Adams (2019) show that the truncation distribution that maximizes the ROE is proportional to the rate of decay of our approximation divided by its computational cost. The error of CG decays as $\mathcal{O}(C^{-2J})$ , and the cost of each summation term is constant with respect to $J$ . In practice, we vary the exponential decaying rate to control the expectation and variance of $\mathbb{P}(J)$ . To further reduce the variance of our estimator, we set a minimum number of CG iterations to be computed, as in (Luo et al., 2020). See appendix for full proof. + +In practice, however, we do not have access to $C$ since computing the conditioning of $\widehat{\mathbf{K}}_{\mathbf{XX}}$ is impractical. Yet, we can change the base of the exponential to $e$ and add a temperature parameter $\lambda$ to rescale the function and control the rate of decay of the truncation distribution as a sensible alternative. Thus, we follow a more general exponential decay distribution: + +$$ +\mathbb {P} (J) \propto e ^ {- \lambda J}, \quad J = J _ {\min }, \dots , N \tag {17} +$$ + +where $J_{\mathrm{min}}$ is the minimum truncation number. By varying the values of $\lambda$ and $J_{\mathrm{min}}$ , we can control the expectation and standard deviation of $\mathbb{P}(J)$ . In practice we found that having the standard deviation value between 10 and 20 achieves stable GP learning process, which can be obtained by tuning $\lambda$ between 0.05 and 0.1 for sufficiently large datasets (e.g. $N \geq 500$ ). We also noticed that the method is not sensitive to these choices of hyperparameters and that they work well across all the experiments. The expected truncation number can be further tuned by varying $J_{\mathrm{min}}$ . We emphasize that these choices impact the speed-variance tradeoff. By setting a larger $J_{\mathrm{min}}$ we decrease the speed by requiring more baseline computations but also decrease the variance (since the minimum approximations have the largest deviations from the ground truth). + +Toy problem. In Fig. 1 we plot the empirical mean of the RR-CG estimator using $10^{4}$ samples from an exponential truncation distribution. We find that RR-CG produces unbiased estimates of the $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ terms that are indistinguishable from the exact values computed with Cholesky. Reducing the expected truncation iteration $\mathbb{E}(J)$ (x-axis) increases the standard error of empirical means, demonstrating the speed-variance trade-off. + +# 4.2. Single Sample-Truncated RFF (SS-RFF) + +Denoting $\widetilde{\mathbf{K}}_j$ as the kernel matrix estimated by $j$ random Fourier features, we can write $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ as the following telescoping series: + +$$ +\begin{array}{l} \log | \widehat {\mathbf {K}} _ {\mathbf {X X}} | = \log | \widetilde {\mathbf {K}} _ {1} | + \sum_ {j = 2} ^ {N / 2 - 1} \left(\log | \widetilde {\mathbf {K}} _ {j} | - \log | \widetilde {\mathbf {K}} _ {j - 1} |\right) (18) \\ + \log | \widehat {\mathbf {K}} _ {\mathbf {X X}} | - \log | \widetilde {\mathbf {K}} _ {N / 2 - 1} | \\ = \log | \widetilde {\mathbf {K}} _ {1} | + \sum_ {j = 2} ^ {N / 2} \Delta_ {j}, (19) \\ \end{array} +$$ + +where $\Delta_{j}$ is defined as $\log |\widetilde{\mathbf{K}}_j| - \log |\widetilde{\mathbf{K}}_{j - 1}|$ for all $j < N / 2$ , and $\Delta_{N / 2}$ is defined as $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}| - \log |\widetilde{\mathbf{K}}_{N / 2 - 1}|$ . Note that each $\Delta_{j}$ is now a random variable, since it depends on the random Fourier frequencies $\omega$ . Crucially, we only include $N / 2$ terms in the series so that no term requires more than $\mathcal{O}(N^3)$ computation in expectation. (For any $j > N / 2$ , $\widetilde{\mathbf{K}}_j$ is a full-rank matrix and thus is as computationally expensive as the true $\widehat{\mathbf{K}}_{\mathbf{XX}}$ matrix.) We construct a similar telescoping series for $\mathbf{y}^\top \widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ . + +As with Eq. (16), we approximate the series in Eq. (19) with a randomized truncation estimator, this time using the Single Sample estimator (7): + +$$ +\log | \widehat {\mathbf {K}} _ {\mathbf {X X}} | \approx \log | \widetilde {\mathbf {K}} _ {1} | + \Delta_ {J} / \mathbb {P} (J). \tag {20} +$$ + +where $J$ is drawn from the truncation distribution $\mathbb{P}(J)$ with support over $\{2,3,\dots N / 2\}$ . Note that the Single Sample estimate requires computing 3 log determinants (log $|\widetilde{\mathbf{K}}_1|$ , $\log |\widetilde{\mathbf{K}}_{J - 1}|$ , and $\log |\widetilde{\mathbf{K}}_J|)$ for a total of $\mathcal{O}(J^3 +NJ^2)$ computations and $\mathcal{O}(NJ)$ memory. This is asymptotically the same requirement as standard RFF. The Russian Roulette estimator, on the other hand, incurs a computational cost of $\mathcal{O}(NJ^3 +J^4)$ as it requires computing ( $\log |\widetilde{\mathbf{K}}_1|$ through $\log |\widetilde{\mathbf{K}}_J|$ ) which quickly becomes impractical for large $J$ . + +A similar Single Sample estimator constructs an unbiased estimate of $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ . Backpropagating through these Single Sample estimates produces unbiased estimates of the log marginal likelihood gradient in Eq. (2). + +Choosing the truncation distribution. For the Single Sample estimator we do not have to optimize the ROE since + +minimizing the variance of this estimator does not result in a degenerate distribution. + +Theorem 4. The truncation distribution that minimizes the variance of the SS-RFF estimators for $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ and $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ is $\mathbb{P}^{*}(J)\propto 1 / J$ . The expected variance and computation of $\mathbb{P}^{*}(J)$ is finite. + +Proof sketch. The minimum variance distribution can be found by solving a constrained optimization problem. In practice, we can further decrease the variance of our estimator by fixing a minimum value of RFF features to be used in Eq. (19) and by increasing the step size $(c\in \mathbb{N})$ between the elements at each $\Delta_j = \log |\widetilde{\mathbf{K}}_{cJ}| - \log |\widetilde{\mathbf{K}}_{c(J - 1)}|$ . See appendix for full proof. + +For the experiments we started with 500 features and also tried various step sizes $c \in \{1, 10, 100\}$ . The variance of the estimator decreases as we increase $c$ since the probability weights will decrease in magnitude. Yet, despite of using the optimal truncation distribution, setting a high number of features and taking long steps $c = 100$ , the variance of the estimator still requires taking several steps before converging, making SS-RFF computationally impractical. + +Toy problem. Similar to RR-CG, in Fig. 1 we plot the empirical mean of the SS-RFF estimator using $10^{4}$ samples. We find that SS-RFF produces unbiased estimates of the $\mathbf{y}^{\top}\widehat{\mathbf{K}}_{\mathbf{XX}}^{-1}\mathbf{y}$ and $\log |\widehat{\mathbf{K}}_{\mathbf{XX}}|$ terms. However, these estimates have a higher variance when compared to the estimates of RR-CG. Reducing the expected truncation iteration $\mathbb{E}(J)$ (x-axis) increases the standard error of the empirical means, demonstrating the speed-variance trade-off. + +# 4.3. Analysis of the Bias-free Methods + +Randomized truncations and conjugate gradients have existed for many decades (Hestenes et al., 1952; Kahn, 1955), but have rarely been used in conjunction. Filippone & Engler (2015) proposed a method closely related to our RRCG which performs randomized early-truncation of CG iterations to obtain unbiased posterior samples of the GP covariance parameters. We differ by tackling the GP hyperparameter learning problem: we provide the first theoretical analysis of the biases incurred by both CG and RFF, and proceed to tailor unbiased estimators for each method. + +To some extent, randomized truncation methods are antithetical to the original intention of CG: producing deterministic and nearly exact solves. For large-scale applications, where early truncation is necessary for computational tractability, the ability to trade bias for variance is beneficial. This fact is especially true in the context of GP learning, where the bias of early truncation is systematic and cannot be simply explained away as numerical imprecision. + +Randomized truncation estimates are often used to estimate + +![](images/495420eb0e1ebd18b3860233d98c70be461c456f67a546cd3aab9b44acb261bc.jpg) +Figure 3. Optimization landscape of a GP with two hyperparameters. The SS-RFF and RR-CG models converge to similar hyperparameter values that are nearly optimal, while the RFF and CG models converge to suboptimal solutions. In addition, the stochastic effect of the randomized truncation is visible in the trajectories of RR-CG and SS-RFF. Moreover, CG (and RR-CG) models truncate after 20 iterations (in expectation); RFF (and SS-RFF) models use 700 features (in expectation). + +infinite series, where it is challenging to design truncation distributions with finite expected computation and/or variance. We avoid such issues since CG and the telescoping RFF summations are both finite. + +# 5. Results + +First, we show that our bias-free methods recover nearly the same hyperparameters as exact methods (i.e. Cholesky-based optimization), whereas models that use CG and RFF converge to suboptimal hyperparameters. Since RR-CG and SS-RFF eliminate bias at the cost of increased variance, we then demonstrate the optimization convergence rate and draw conclusions on our methods' applicability. Finally, we compare models optimized with RR-CG against a host of approximate GP methods across a wide range of UCI datasets (Asuncion & Newman, 2007). All experiments are implemented in GPyTorch (Gardner et al., 2018) + +Optimization trajectories of bias-free GP. Fig. 3 displays the optimization landscape – the log marginal likelihood of the PoleTele dataset – as a function of (RBF) kernel lengthscale $\ell$ and noise $\sigma^2$ . As expected, an exact GP (optimized using Cholesky, Fig. 3 upper left) recovers the optimum. Notably, the GP trained with standard CG and RFF converges to suboptimal hyperparameters (upper right/ lower right). RR-CG and SS-RFF models (trained with 20 iterations and 700 features in expectation, respectively) successfully eliminate this bias, and recover nearly + +![](images/dcd08e7d969e8e426549f2ba1059524140bdb3052de3b257fc1793709a6344ac.jpg) +Figure 4. The GP optimization objective for models trained with RFF and SS-RFF. (PoleTele dataset, RBF kernel, Adam optimizer.) RFF models converge to sub-optimal log marginal likelihoods. SS-RFF models converge to (near) optimum values, yet require more than $100 \times$ as many optimization steps. + +![](images/4e96164922f83c763403b80bec0a93cf8d9026cb7a85c2957e37581ddcd4a1e2.jpg) +Figure 5. The GP optimization objective for models trained with CG and RR-CG. (Bike dataset, RBF kernel, Adam optimizer.) RR-CG models converge to optimal solutions, while the (biased) CG models diverge. Increasing the expected truncation of RR-CG only slightly improves optimization convergence; models converge in $< 100$ steps of Adam. + +the same parameters as the exact model (upper center/ lower left). These plots also show the speed-variance tradeoff of randomized truncation. SS-RFF and RR-CG have noisy optimization trajectories due to auxiliary truncation variance. + +Convergence of GP hyperparameter optimization. Figs. 4 and 5 plot the exact GP log marginal likelihood of the parameters learned by each method during optimization. Each trajectory corresponds to a RBF-kernel GP trained on the PoleTele dataset (Fig. 4) and the Bike dataset (Fig. 5). + +Fig. 4 shows that RFF models converge to solutions with worse log likelihoods, and more RFF features slow the rate of optimization. Additionally, we see the cost of the auxiliary variance needed to debias SS-RFF: while SS-RFF models achieve better optima than their biased counterparts, they take 2-3 orders of magnitude longer to converge, despite using a truncation distribution that minimizes variance. We thus conclude that SS-RFF has too much variance to be practical for GP hyperparameter learning. + +Fig. 5 on the other hand shows that RR-CG is minimally affected by its auxiliary variance. The GP trained with RR-CG converges in roughly 100 iterations, nearly matching Cholesky-based optimization. Decreasing the expected truncation value from $\mathbb{E}[J] = 40$ to 20 slightly slows this convergence. We note that the bias induced by standard CG can be especially detrimental to GP learning. On this dataset, the biased models deviate from their Cholesky counterparts and eventually diverge away from the optimum. + +Predictive performance of bias-free GP. Lastly, we compare the predictive performance of GPs that use RR-CG, CG, and Cholesky for hyperparameter optimization. We emphasize that the RR-CG and CG methods only make use of early truncation approximations during training. At test time, we compute the predictive posterior by running CG to a tolerance of $\leq 10^{-4}$ , which we believe can be considered "exact" for practical intents and purposes. Additionally, we include four other (biased) scalable GP approximations methods as baselines: RFF, Stochastic Variational Gaussian Processes (SVGP) (Hensman et al., 2013), generalized Product of Expert Gaussian Processes (POE) (Cao & Fleet, 2014; Deisenroth & Ng, 2015), and stochastic gradient-based Gaussian Processes (sgGP) (Chen et al., 2020). We note that the RFF, SVGP, and sgGP methods introduce both bias and variance, as these methods rely on randomization and approximation. + +We use CG with $J = 100$ iterations, and RR-CG with $\mathbb{E}[J] = 100$ expected iterations; both methods use the preconditioner of Gardner et al. (2018). All RFF models use 700 random features. For SVGP, we use 1,024 inducing points and minibatches of size 1,024 as in (Wang et al., 2019). The POE models are comprised of GP experts that are each trained on 1,024 data point subsets. For sgGP, the subsampled datasets are constructed by selecting a random point $x, y$ and its 15 nearest neighbors as in (Chen et al., 2020). Each dataset is randomly split to $64\%$ training, $16\%$ validation and $20\%$ testing sets. All kernels are RBF with a separate lengthscale per dimension. See appendix for more details. + +We report prediction accuracy (RMSE) and negative log likelihood (NLL) in Fig. 6 (see appendix for full tables on predictive performance and training time). We make two key observations: (i) RR-CG meaningfully debiases CG. When the bias of CG is not detrimental to optimization (e.g. CG with 100 iterations is close to convergence for the Elevators dataset), RR-CG has similar performance. However, when the CG bias is more significant (e.g. the KEGG dataset), the bias-free RR-CG improves the GP predictive RMSE and NLL. We also include a figure displaying the predictive performance of RR-CG and CG with increasing number of (expected) CG iterations in appendix. (ii) RR-CG recovers the same optimum as the "ground-truth" method + +![](images/fe3140defce32f95a96df48d017812ef4a61f27a7d073467b03ff6f9307c440e.jpg) +Figure 6. Root-mean-square-error (RMSE) and negative log likelihood (NLL) of GP trained with CG (light purple), RR-CG (dark purple) and various approximate methods (grey). Dashed red lines indicate Cholesky-based GP performance (when applicable). Results are averaged over 3 dataset splits. Missing RFF and sgGP results correspond to (very high) outlier NLL / RMSE values. In almost all experiments, GP learning with RR-CG achieves similar or better performance compared to that with CG at the same computational cost. + +(i.e. Cholesky) does, as indicated by the red-dashed line in Fig. 6. This result provides additional evidence that RR-CG achieves unbiased optimization. + +While RR-CG obtains the lowest RMSE on all but 2 datasets, we note that the (biased) GP approximations sometimes achieve lower NLL. For example, SVGP has a lower NLL than that of RR-CG on the Bike dataset, despite having a higher RMSE. We emphasize that this is not a failing of RR-CG inference. The SVGP NLL is even better than that of the exact (Cholesky) GP, suggesting a potential model misspecification for this particular dataset. Since SVGP overestimates the observational noise $\sigma^2$ (Bauer et al., 2016), it may obtain a better NLL when outliers are abundant. Though we cannot compare against the Cholesky posterior on larger datasets, we hypothesize that the NLL/RMSE discrepancy on these datasets is due to a similar modeling issue. + +# 6. Conclusion + +We prove that CG and RFF introduce systematic biases to the GP log marginal likelihood objective: CG-based training will favor underfitting models, while RFF-based training will promote overfitting. Modifying these methods with randomized truncation converts these biases into variance, enabling unbiased stochastic optimization. Our results show that this bias-to-variance exchange indeed constitutes a trade-off. The convergence of SS-RFF is impractically slow, likely due to the truncation variance needed to eliminate RFF's slowly-decaying bias. However, for CG-based + +training, we find that variance is almost always preferable to bias. Models trained with RR-CG achieve better performance than those trained with standard CG, and tend to recover the hyperparameters learned with exact methods. Though models trained with CG do not always exhibit noticeable bias, RR-CG's negligible computational overhead is justifiable to counteract cases where the bias is significant. + +We reported experiments with at most 300K observations for our methods and baselines, which is substantial for GPs. We emphasize that RR-CG can be extended to datasets with over one million data points as in Wang et al. (2019). However, the computational cost is much higher, requiring multiple GPUs for training and testing. + +We note that the RR-CG algorithm is not limited to GP applications. Future work should explore applying RR-CG to other optimization problems with large-scale solves. + +# Acknowledgements + +This work was supported by the Simons Foundation, McKnight Foundation, the Grossman Center, and the Gatsby Charitable Trust. + +# References + +Asuncion, A. and Newman, D. Uci machine learning repository, 2007. + +Bauer, M., van der Wilk, M., and Rasmussen, C. E. Understanding probabilistic sparse gaussian process approxi + +mations. In Advances in Neural Information Processing Systems, 2016. +Beatson, A. and Adams, R. P. Efficient optimization of loops and limits with randomized telescoping sums. In International Conference on Machine Learning, 2019. +Bochner, S. et al. Lectures on Fourier integrals, volume 42. Princeton University Press, 1959. +Burt, D., Rasmussen, C. E., and Van Der Wilk, M. Rates of convergence for sparse variational gaussian process regression. In International Conference on Machine Learning, pp. 862-871, 2019. +Cao, Y. and Fleet, D. J. Generalized product of experts for automatic and principled fusion of gaussian process predictions. arXiv preprint arXiv:1410.7827, 2014. +Chen, H., Zheng, L., Al Kontar, R., and Raskutti, G. Stochastic gradient descent in correlated settings: A study on gaussian processes. Advances in Neural Information Processing Systems, 33, 2020. +Chen, R. T. Q., Behrmann, J., Duvenaud, D., and Jacobsen, J.-H. Residual flows for invertible generative modeling. Advances in Neural Information Processing Systems, 2019. +Cunningham, J. P., Shenoy, K. V., and Sahani, M. Fast gaussian process methods for point process intensity estimation. In International Conference on Machine learning, pp. 192-199, 2008. +Cutajar, K., Osborne, M. A., Cunningham, J. P., and Filippone, M. Preconditioning kernel matrices. In International Conference on Machine Learning, 2016. +Datta, A., Banerjee, S., Finley, A. O., and Gelfand, A. E. Hierarchical nearest-neighbor gaussian process models for large geostatistical datasets. Journal of the American Statistical Association, 111(514):800-812, 2016. +Deisenroth, M. and Ng, J. W. Distributed gaussian processes. In International Conference on Machine Learning, pp. 1481-1490. PMLR, 2015. +Dong, K., Eriksson, D., Nickisch, H., Bindel, D., and Wilson, A. G. Scalable log determinants for gaussian process kernel learning. In Advances in Neural Information Processing Systems, pp. 6327-6337, 2017. +Filippone, M. and Engler, R. Enabling scalable stochastic gradient-based inference for gaussian processes by employing the unbiased linear system solver (ulisse). In International Conference on Machine Learning, pp. 1015-1024. PMLR, 2015. + +Gardner, J., Pleiss, G., Weinberger, K. Q., Bindel, D., and Wilson, A. G. Gpytorch: Blackbox matrix-matrix gaussian process inference withgpu acceleration. In Advances in Neural Information Processing Systems, pp. 7576-7586, 2018. +Golub, G. H. and Van Loan, C. F. Matrix Computations. The Johns Hopkins University Press, 4th Edition, 2012. +Hensman, J., Fusi, N., and Lawrence, N. D. Gaussian processes for big data. In Uncertainty in Artificial Intelligence, 2013. +Hestenes, M. R., Stiefel, E., et al. Methods of conjugate gradients for solving linear systems. Journal of Research of the National Bureau of Standards, 49(1), 1952. +Hutchinson, M. F. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 18(3):1059-1076, 1989. +Kahn, H. Use of different monte carlo sampling techniques. Rand Corporation, 1955. +Katzfuss, M., Guinness, J., et al. A general framework for vecchia approximations of gaussian processes. Statistical Science, 36(1):124-141, 2021. +Loper, J., Blei, D., Cunningham, J. P., and Paninski, L. General linear-time inference for gaussian processes on one dimension. arXiv preprint arXiv:2003.05554, 2020. +Luo, Y., Beatson, A., Norouzi, M., Zhu, J., Duvenaud, D., Adams, R. P., and Chen, R. T. Q. Sumo: Unbiased estimation of log marginal probability for latent variable models. In International Conference on Learned Representations, 2020. +Lyne, A.-M., Girolami, M., Atchade, Y., Strathmann, H., Simpson, D., et al. On russian roulette estimates for bayesian inference with doubly-intractable likelihoods. Statistical science, 30(4):443-467, 2015. +Mutny, M. and Krause, A. Efficient high dimensional bayesian optimization with additivity and quadrature fourier features. Advances in Neural Information Processing Systems, pp. 9005-9016, 2018. +Nowozin, S. Debiasing evidence approximations: On importance-weighted autoencoders and jackknife variational inference. In International Conference on Learned Representations, 2018. +Oktay, D., McGreivy, N., Aduol, J., Beatson, A., and Adams, R. P. Randomized automatic differentiation. arXiv preprint arXiv:2007.10412, 2020. + +Rahimi, A. and Recht, B. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems, pp. 1177-1184, 2008. +Snelson, E. and Ghahramani, Z. Sparse Gaussian processes using pseudo-inputs. In Advances in Neural Information Processing Systems, 2006. +Sutherland, D. J. and Schneider, J. G. On the error of random fourier features. Conference on Uncertainty in Artificial Intelligence, 2015. +Titsias, M. K. Variational learning of inducing variables in sparse Gaussian processes. In International Conference on Artificial Intelligence and Statistics, pp. 567-574, 2009. +Ubaru, S., Chen, J., and Saad, Y. Fast estimation of tr(f(a)) via stochastic lanczos quadrature. SIAM Journal on Matrix Analysis and Applications, 38(4):1075-1099, 2017. +Wang, K., Pleiss, G., Gardner, J., Tyree, S., Weinberger, K. Q., and Wilson, A. G. Exact gaussian processes on a million data points. In Advances in Neural Information Processing Systems, pp. 14648-14659, 2019. +Wilson, J., Borovitskiy, V., Terenin, A., Mostowsky, P., and Deisenroth, M. Efficiently sampling functions from gaussian process posteriors. In International Conference on Machine Learning, pp. 10292-10302, 2020. \ No newline at end of file diff --git a/biasfreescalablegaussianprocessesviarandomizedtruncations/images.zip b/biasfreescalablegaussianprocessesviarandomizedtruncations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0a75dac15a8df31775778d439ba3d832f377d54d --- /dev/null +++ b/biasfreescalablegaussianprocessesviarandomizedtruncations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd8a3f6642bc0887198c871dbae5b74aa58f4b24253e342ecdfec6c2c57c7a40 +size 391041 diff --git a/biasfreescalablegaussianprocessesviarandomizedtruncations/layout.json b/biasfreescalablegaussianprocessesviarandomizedtruncations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..34a220d24b2f2977092dbc143a7d394272ee9f04 --- /dev/null +++ b/biasfreescalablegaussianprocessesviarandomizedtruncations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:076beea131826a16a1f9d29187f0c545934493c5d6ad1b7380ad533667bb46a9 +size 507772 diff --git a/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_content_list.json b/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f10cac3796f9d3c4765f09d87f5bc5910d47fbe1 --- /dev/null +++ b/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cca46008c124e2f56da0cc2c844734ec59e3c60b4e2d4541659e6ca2b4bf252b +size 94719 diff --git a/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_model.json b/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a3a9d418b047848087933cebb98ec6c2e228c609 --- /dev/null +++ b/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:093ed7b13c9e0a51ee877692875ba43bf22ddb8ca4a1f74de37ae70f5cc01656 +size 112741 diff --git a/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_origin.pdf b/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..233510c3546664bc0fd2fb0a0bb755d4a91380a1 --- /dev/null +++ b/biasrobustbayesianoptimizationviaduelingbandits/62255f58-ac8c-4f3b-accd-220be809ce3d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9eba9d6326bcdeffc8a09d91c4a05d670c480c289d5a804d162f20e8b8cca2ad +size 3785404 diff --git a/biasrobustbayesianoptimizationviaduelingbandits/full.md b/biasrobustbayesianoptimizationviaduelingbandits/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b3ad1ceca1148122aa7f1c07ffe033d059cef4c2 --- /dev/null +++ b/biasrobustbayesianoptimizationviaduelingbandits/full.md @@ -0,0 +1,488 @@ +# Bias-Robust Bayesian Optimization via Dueling Bandits + +Johannes Kirschner1 Andreas Krause1 + +# Abstract + +We consider Bayesian optimization in settings where observations can be adversarially biased, for example by an uncontrolled hidden confounder. Our first contribution is a reduction of the confounded setting to the dueling bandit model. Then we propose a novel approach for dueling bandits based on information-directed sampling (IDS). Thereby, we obtain the first efficient kernelized algorithm for dueling bandits that comes with cumulative regret guarantees. Our analysis further generalizes a previously proposed semiparametric linear bandit model to non-linear reward functions, and uncovers interesting links to doubly-robust estimation. + +# 1. Introduction + +Bayesian optimization (Mockus, 1982) is a model-based approach for zero-order global optimization with noisy feedback. It has been successfully applied to many applications such as hyper-parameter tuning of machine learning models, robotics and chemical design. Some variants such as Expected-Improvement (Bull, 2011) or the GP-UCB algorithm (Srinivas et al., 2010) come with theoretical guarantees, ensuring convergence to the global optimum in finite time under suitable regularity assumptions. Closely related is the field of bandit algorithms (Lattimore & Szepesvári, 2020), in particular the linear bandit model (Abe & Long, 1999; Dani et al., 2008; Abbasi-Yadtori et al., 2011). + +Most linear bandit algorithms and Bayesian optimization approaches require that the true function is realized in a known reproducing kernel Hilbert space (RKHS) and rely on unbiased evaluations of the objective. The regularity assumptions raise questions of robustness to miss-specification and adversarial attacks, and addressing these limitations has been the content of several recent works (Lykouris et al., 2018; Bogunovic et al., 2020b;a). + +We study a setting where the learner's objective is to maximize an unknown function $f: \mathcal{X} \to \mathbb{R}$ with additive confounded feedback, + +$$ +y _ {t} = f \left(x _ {t}\right) + b _ {t} + \epsilon_ {t}, \tag {1} +$$ + +where $x_{t}$ is the evaluation point chosen by the learner at time $t$ , $\epsilon_{t}$ is $\sigma^2$ -sub-Gaussian (zero-mean) observation noise, and $b_{t}$ is an additive confounding term. We assume that $b_{t}$ is chosen by an adversary, but does not depend on the input $x_{t}$ . The bias term allows to model the influence of an unobserved and uncontrolled covariate, or a perturbation of the feedback signal imposed by an adversary. One can also interpret (1) as a contextual model, where $b_{t}$ captures the effect of a changing (unobserved) context on the reward. We discuss further examples and applications in Section 1.1 below. + +The proposed feedback model (1) generalizes the semi-parametric contextual bandit model studied by Krishnamurthy et al. (2018), where $f(x_{t}) = \langle x_{t},\theta \rangle$ is a linear function defined by a parameter $\theta \in \mathbb{R}^d$ . They show that a doubly-robust least-squares estimator allows to recover reward differences $\langle x - x',\theta \rangle$ for inputs $x,x^{\prime}\in \mathbb{R}^{d}$ despite the confounding. They further propose an elimination-style algorithm, bandit orthogonalized semiparametric estimation (BOSE), which is based on sampling actions from a distribution that minimizes the variance of the estimator. However, finding low variance distributions requires solving a convex-quadratic feasibility problem, which is computationally demanding and in general leads to sampling distributions with support that spans $\mathbb{R}^d$ . + +Contributions Our first contribution is two reductions of the confounded feedback model (1) to the dueling bandit setting. This allows us to leverage existing algorithms for dueling bandits in the confounded observation setting. We then propose the first efficient algorithm for kernelized dueling bandits that comes with theoretical guarantees on the cumulative regret. The approach is based on information-directed sampling (IDS), which was recently studied in the context of linear partial monitoring by Kirschner et al. (2020b). In particular, we propose an efficient approximation of IDS, that reduces the computation complexity from $\mathcal{O}(|\mathcal{X}|^4)$ to $\mathcal{O}(|\mathcal{X}|)$ on finite action sets $\mathcal{X}$ . For continuous action sets, the proposed algorithm requires to optimize a (non-convex) acquisition function over the input space, akin to standard Bayesian optimization. + +# 1.1. Motivating Examples + +We start by motivating our problem through applications. + +Range-Adjusting Measurement Devices In many real-world optimization tasks, the observed feedback arises from a physical sensing device. Such measurement devices can be subject to calibration errors or might automatically adjust the output range for better sensitivity. For example, in optimization of free electron lasers (Kirschner et al., 2019; Duris et al., 2020), the target signal is measured with a gas-detector, which exploits a physical law to amplify the signal. An input voltage is used to control the amplification factor, which requires re-adjustment1 with increasing target signal such that the physical relationship between the target and the measured output stays approximately linear2 (Sorokin et al., 2019; Juranic et al., 2018). Our feedback model allows optimization that is robust to absolute changes in the target signal occurring at any time. + +Distributed Optimization of Additive Functions In high-dimensional settings, previous work on Bayesian optimization often uses structural assumptions to reduce the dependence of the sample complexity on the dimension. One popular choice is additivity (Kandasamy et al., 2015), for example coordinate-wise $f(x) = \sum_{i\in [d]}f_i(x^i)$ . To optimize additive functions, we can apply $d$ individual learners to optimize each 1-dimensional component $f_{i}$ separately. Note that the learners cannot directly evaluate $f_{i}(x_{i})$ , but only obtain the global noisy feedback $f(x) + \epsilon$ , which depends on the choices $x = (x^{1},\ldots ,x^{d})$ of all learners. When the learners act in parallel and there is no communication possible, the feedback of each learner is confounded as in (1) by the other learner's choices. Our robust approach guarantees that the learners are able to optimize each component successfully, despite the confounding. + +Adversarial Attacks Robustness to adversarial attacks was studied recently in the context of bandit algorithms (Lykouris et al., 2018; Bogunovic et al., 2020b) and Bayesian optimization (Bogunovic et al., 2020a). In all previous work that we are aware of, the corruption of the feedback is allowed to depend on the actions, with varying assumptions of whether or not the adversary observes the action choice of the learner. Note that our feedback model is more stringent, as it does not allow for action dependence. On the other hand, our model allows for sublinear regret even with a constant corruption in every round, whereas in previous work, the regret scales with the total amount of corruption. + +1Translating the range-adjusted signal into an absolute value is possible, but not straightforward and comes with other limitations. 2More precisely, the relationship depends on the photon energy, pulse intensity, and physical properties of the gas involved. + +# 1.2. Related Work + +There is a vast amount of literature on bandit algorithms (Lattimore & Szepesvári, 2020) and Bayesian optimization (Mockus, 1982; Srinivas et al., 2010; Shahriari et al., 2016; Frazier, 2018). Our feedback model is a generalization of the semi-parametric linear bandit setting proposed by Krishnamurthy et al. (2018) with applications for example in mobile health (Tewari & Murphy, 2017). A variant of Thompson sampling was analyzed in the same setting by Kim & Paik (2019), which they show outperforms the BOSE approach by Krishnamurthy et al. (2018), but the frequentist regret bound they derive has an extra factor in the dimension. The Thompson sampling variant is also computationally more efficient, but requires to explicitly compute the probabilities that each action is optimal under the posterior distribution. For Bayesian optimization, robust variants have been considered recently, for example with adversarial perturbations of the input (Bogunovic et al., 2018), corruption of the output (Bogunovic et al., 2020a) and distributionally robust optimization (Kirschner et al., 2020a). In the context of adversarial attacks, there is an increasing body of work (Lykouris et al., 2018; Li et al., 2019; Liu & Lai, 2020; Gupta et al., 2019; Bogunovic et al., 2020a;b), however the feedback model differs from ours, see also the discussion in Section 1.1. + +Of particular relevance to our work is the (stochastic)ueling bandit setting (Yue et al., 2012; Sui et al., 2018; Bengs et al., 2021) and kernelized variants (Sui et al., 2017a;b). Early work by Yue & Joachims (2009) applied theueling bandit model to the optimization setting with continuous action sets and concave reward functions, and established a connection to gradient-based optimization. However, to the best of our knowledge, none of the previous works provide bounds on the cumulative regret in the kernelized (nonconcave) setting. A kernelized algorithm with theoretical guarantees that requires point evaluations andueling feedback is by Xu et al. (2020). Closely related is also the work by Saha & Gopalan (2020) on linearueling bandits with possibly infinite input spaces. They establish a connection to the generalized linear bandit model (GLM) and propose an algorithm which, similar to ours, relies on finding an informative action pair with low regret. However, gap-dependent bounds and a kernelized variant was not provided, and for finite action sets $\mathcal{X}$ , their algorithm requires $\mathcal{O}(|\mathcal{X}|^2)$ computation steps per round. Recent work by Agarwal et al. (2021) considers the finite-armedueling bandit setting with adversarial corruptions of the feedback. Lastly, we remark that most previous work onueling bandits considers binary feedback, whereas here we are interested in quantitative feedback on the reward-difference between the chosen action pair. Formally, we consider sub-Gaussianueling feedback which includes the Bernoulli likelihood, but does not exploit the heteroscedasticity of binary observations. + +# 2. Setting + +Let $\mathcal{X} \subset \mathbb{R}^d$ be a compact input space and $f: \mathcal{X} \to \mathbb{R}$ a fixed and unknown objective function. In each round $t = 1, \ldots, n$ , the learner chooses an action $x_t \in \mathcal{X}$ and observes the confounded outcome + +$$ +y _ {t} = f (x _ {t}) + b _ {t} + \epsilon_ {t}, +$$ + +where $\epsilon_{t}$ is $\sigma^2$ -sub-Gaussian, conditionally independent noise, and $b_{t} \in \mathbb{R}^{d}$ is an unobserved and possibly time-dependent confounding term. We assume that $b_{t}$ does not depend on the current action $x_{t}$ chosen by the learner, and satisfies one of the following assumptions: + +a) The bias $b_{t}$ is bounded, $|b_{t}| \leq C_{max}$ and fixed at the beginning of round $t$ , but can otherwise arbitrarily depend on $(x_{s}, y_{s})_{s=1}^{t-1}$ . +b) The difference between two consecutive bias terms is bounded, $|b_{t} - b_{t-1}| \leq D_{max}$ and $b_{t}$ is fixed at the beginning of round $t-1$ , but can otherwise arbitrarily depend on $(x_{s}, y_{s})_{s=1}^{t-2}$ . + +Which assumption is used is specified in the relevant context. Let $x^{*} \in \arg \max_{x \in \mathcal{X}} f(x)$ be the optimal action. The suboptimality gap is $\Delta(x) = f(x^{*}) - f(x)$ . The learner's objective is to maximize the cumulative reward $\sum_{t=1}^{n} f(x_{t})$ , or equivalently minimize the regret, + +$$ +R _ {n} = \sum_ {t = 1} ^ {n} f (x ^ {*}) - f (x _ {t}) = \sum_ {t = 1} ^ {n} \Delta (x _ {t}). +$$ + +For the analysis, we assume that the function $f$ is in a known reproducing kernel Hilbert space (RKHS) $\mathcal{H}$ with associated kernel $k: \mathcal{X} \times \mathcal{X} \to \mathbb{R}$ and bounded Hilbert norm $\| f \|_{\mathcal{H}} \leq B$ . This is a standard assumption in Bayesian optimization (Srinivas et al., 2010; Chowdhury & Gopalan, 2017) and justifies the use of kernelized least-squares regression, formally introduced in Section 4. We further require that the kernel function is bounded, $k(x, x) \leq 1$ . + +# 3. Reduction to Dueling Bandits + +It is clear from the observation model (1) that any additive shift of the objective, i.e. $\tilde{f}(x) = f(x) + c$ for $c \in \mathbb{R}$ , can be absorbed in the unobserved confounding terms $b_{t}$ , hence rendering the observation sequences for $f(x)$ and $\tilde{f}(x)$ indistinguishable. In particular, the learner can only hope to recover the true function up to an additive constant. Fortunately, to determine the best action $x^{*} = \arg \max_{x \in \mathcal{X}} f(x)$ , it suffices to estimate reward differences $f(x^{1}) - f(x^{2})$ for actions $x^{1}, x^{2} \in \mathcal{X}$ , which is indeed possible. To do so, previous work in the linear setting relies on doubly-robust estimation (Krishnamurthy et al., 2018; Kim & Paik, 2019). Here + +we take a different approach, and propose a generic reduction of the feedback model (1) to the dueling bandit model (Yue et al., 2012; Sui et al., 2018). The reduction has the advantage that we can leverage existing algorithms for dueling bandits, which also eliminates the need to find low-variance sampling distributions for doubly-robust estimation. + +In dueling bandits, the learner chooses two actions $x_{t}^{1}, x_{t}^{2} \in \mathcal{X}$ and obtains (noisy) feedback on which of the two actions has higher reward. Meanwhile, the learner suffers regret for both actions, but the reward of each action is not observed. While most previous work on dueling bandits uses a binary feedback model, here, we are concerned with a quantitative version of the same setting, which is a special case of linear partial monitoring (Lin et al., 2014). Specifically, for a reward function $f: \mathcal{X} \to \mathbb{R}$ and actions $x_{t}^{1}, x_{t}^{2} \in \mathcal{X}$ , we define quantitative dueling feedback as follows: + +$$ +d _ {t} = f \left(x _ {t} ^ {1}\right) - f \left(x _ {t} ^ {2}\right) + \xi_ {t}, \tag {2} +$$ + +where $\xi_{t}$ is $\rho^2$ -sub-Gaussian observation noise and $\rho$ is known to the learner. The distribution of $\xi_{t}$ is allowed to depend on $(x_{t}^{1}, x_{t}^{2})$ as long as the sub-Gaussian tail assumption is satisfied uniformly over all actions. Note that this includes binary feedback typically used forueling bandits, and, more generally, bounded noise distributions. Next, we present two reductions schemes to generate theueling bandit feedback (2) from confounded observations (1). + +Two-Point Reduction The first scheme uses two confounded observations to construct the dueling bandit feedback. Given two inputs $x_{t}^{1}, x_{t}^{2} \in \mathcal{X}$ in round $t$ , we evaluate both points according to (1), where the order of evaluation is uniformly randomized. The two observations are + +$$ +\begin{array}{l} y _ {t} ^ {1} = f \left(x _ {t} ^ {1}\right) + b _ {2 t + i _ {t}} + \epsilon_ {2 t + i _ {t}}, \\ y _ {t} ^ {2} = f (x _ {t} ^ {2}) + b _ {2 t + 1 - i _ {t}} + \epsilon_ {2 t + 1 - i _ {t}}, \\ \end{array} +$$ + +where $i_t \sim \text{Bernoulli}(0.5)$ . We then define + +$$ +d _ {t} = y _ {t} ^ {1} - y _ {t} ^ {2}. \tag {3} +$$ + +Assuming that $b_{2t}$ and $b_{2t+1}$ are fixed before either of $x_t^1, x_t^2$ is chosen by the learner and using that the observation noise $\epsilon_t$ is zero-mean, one easily confirms that $\mathbb{E}[d_t] = f(x_t^1) - f(x_t^2)$ . We further use the following properties of sub-Gaussian random variables. Any random variable $X$ such that $X \in [-B, B]$ is $B^2$ -sub-Gaussian. For two independent random variables $X_1, X_2$ that are $B_1^2$ - and $B_2^2$ -sub-Gaussian respectively, $X_1 + X_2$ is $(B_1^2 + B_2^2)$ -sub-Gaussian. Hence if $|b_{2t} - b_{2t+1}| \leq D_{\max}$ , it follows that + +$$ +\begin{array}{l} \xi_ {t} = d _ {t} - \mathbb {E} [ d _ {t} ] \\ = b _ {2 t + i _ {t}} + \epsilon_ {2 t + i _ {t}} - \left(b _ {2 t + 1 - i _ {t}} + \epsilon_ {2 t + 1 - i _ {t}}\right) \\ \end{array} +$$ + +is $(D_{\mathrm{max}}^2 + 2\sigma^2)$ -sub-Gaussian. + +One-Point Reduction Perhaps surprisingly, one can also construct the dueling bandit feedback from a single observation using randomization. For given inputs $x_{t}^{1}, x_{t}^{2} \in \mathcal{X}$ we choose one point uniformly at random and evaluate the confounded function (1) to obtain a single observation + +$$ +y _ {t} = f \left(x _ {t} ^ {(1 + i _ {t})}\right) + b _ {t} + \epsilon_ {t}, +$$ + +where $i_t \sim \text{Bernoulli}(0.5)$ . The dueling bandit feedback is + +$$ +d _ {t} = (- 1) ^ {i _ {t}} 2 y _ {t}. \tag {4} +$$ + +Again, we get an unbiased observation of the reward difference, $\mathbb{E}[d_t] = f(x_t^1) - f(x_t^2)$ . Further, if $|b_{t}|\leq C_{\mathrm{max}}$ , then $\xi_{t} = d_{t} - \mathbb{E}[d_{t}]$ is $4(C_{\mathrm{max}}^{2} + \sigma^{2})$ -sub-Gaussian. Compared to the two-point reduction, here the sub-Gaussian variance $\rho$ depends on the absolute value $|b_{t}|$ of the confounding term instead of the difference $|b_{t} - b_{t + 1}|$ . On the other hand, the one-point sampling scheme only requires $b_{t}$ to be fixed before the choice of $x_{t}$ , but may depend on all previous actions and observations. + +# 4. Information-Directed Sampling + +With the reduction to dueling feedback, we are set to readily apply any dueling bandit algorithm in the confounded setting. Furthermore, dueling bandits (as defined in (2)) are a special case of partial monitoring, for which also several algorithms exist. In the following, we adapt the information-directed sampling (IDS) approach (Russo & Van Roy, 2014), more specifically, the version proposed by Kirschner et al. (2020b) for linear partial monitoring. The main reason for this choice is that IDS works with quantitative dueling feedback, whereas most other work on dueling bandits focuses on settings with Bernoulli likelihood. Also, IDS can be formulated as a kernelized algorithm, and comes with theoretical guarantees on the regret. However, a direct adaptation of IDS to the dueling setting as proposed by Kirschner et al. (2020b) requires $\mathcal{O}(|\mathcal{X}|^4)$ computational steps per round for finite action sets. In the following, we introduce an approximation of IDS, which obtains the same theoretical guarantees and only requires to optimize a simple score function over the action set. The resulting efficient kernelized dueling bandit algorithm may be of independent interest. On a high level, IDS samples actions from a distribution that minimizes a trade-off between an estimate of the regret and an information gain, as we elaborate below. + +Kernel Regression for Dueling Feedback The first step is to set up kernelized least-squares regression for the Dueling bandit feedback. Recall that we assume that $\mathcal{H}$ is a RKHS with kernel function $k: \mathcal{X} \times \mathcal{X} \to \mathbb{R}$ and $f \in \mathcal{H}$ with $\|f\|_{\mathcal{H}} \leq B$ . In round $t$ , the learner has already collected data $\mathcal{D}_t = \{(x_s^1, x_s^2, d_s)\}_{s=1}^{t-1}$ , where $x_s^1, x_s^2 \in \mathcal{X}$ is the input pair chosen at step $s$ , and $d_s$ is quantitativeueling + +bandit feedback defined in Eq. (2). The kernel least-squares estimator with regularizer $\lambda > 0$ is + +$$ +\hat {f} _ {t} = \underset {f \in \mathcal {H}} {\arg \min } \sum_ {s = 1} ^ {t - 1} \left(f \left(x _ {s} ^ {1}\right) - f \left(x _ {s} ^ {2}\right) - d _ {s}\right) ^ {2} + \lambda \| f \| _ {\mathcal {H}} ^ {2} \tag {5} +$$ + +The solution corresponds to the posterior mean of the Gaussian process model with kernel $k$ and prior variance $\lambda^{-1}$ and can be computed in closed form. Let $\mathbf{d}_t = [d_1, \ldots, d_{t-1}]^\top$ be the vector which collects the observations and define $K_t \in \mathbb{R}^{t-1 \times t-1}$ and $k_t(x) \in \mathbb{R}^{t-1}$ for $x \in \mathcal{X}$ as follows: + +$$ +\left[ K _ {t} \right] _ {i j} \triangleq k \left(x _ {i} ^ {1}, x _ {j} ^ {1}\right) - k \left(x _ {i} ^ {1}, x _ {j} ^ {2}\right) - k \left(x _ {i} ^ {2}, x _ {j} ^ {1}\right) + k \left(x _ {i} ^ {2}, x _ {j} ^ {2}\right) +$$ + +$$ +[ k _ {t} (x) ] _ {i} \triangleq k (x, x _ {i} ^ {1}) - k (x, x _ {i} ^ {2}) +$$ + +The least-squares solution $\hat{f}_t$ evaluated at any $x\in \mathcal{X}$ is $\hat{f}_t(x) = k_t(x)^\top (K_t + \lambda \mathbf{1})^{-1}\mathbf{d}_t$ , where $\mathbf{1}$ is the identity matrix in the appropriate dimension. To compute uncertainty estimates, we further define + +$$ +k _ {t} (x, y) \triangleq k (x, y) - k _ {t} (x) ^ {\top} \left(K _ {t} + \lambda \mathbf {1}\right) ^ {- 1} k _ {t} (y), +$$ + +$$ +\psi_ {t} (x, z) \triangleq k _ {t} (x, x) ^ {2} + k _ {t} (z, z) ^ {2} - 2 k _ {t} (x, z). \tag {6} +$$ + +For any $t \geq 1$ , $x_1, x_2 \in \mathcal{X}$ , the estimate $\hat{f}_t$ satisfies with probability at least $1 - \delta$ , + +$$ +\begin{array}{l} \left| \hat {f} _ {t} \left(x ^ {1}\right) - \hat {f} _ {t} \left(x ^ {2}\right) - \left(f \left(x ^ {1}\right) - f \left(x ^ {2}\right)\right) \right| ^ {2} \\ \leq \beta_ {t, \delta} \psi_ {t} \left(x ^ {1}, x ^ {2}\right), \tag {7} \\ \end{array} +$$ + +where the confidence coefficient is chosen as follows, + +$$ +\beta_ {t, \delta} ^ {1 / 2} \triangleq \rho \sqrt {\log \det (\mathbf {1} + \lambda^ {- 1} K _ {t}) + 2 \log \frac {1}{\delta}} + \sqrt {\lambda} B. +$$ + +The confidence bound is by Abbasi-Yadkori (2012, Theorem 3.11), which improves upon earlier results by Srinivas et al. (2010). + +Gap Estimate We use $\hat{f}_t$ to define an estimate $\hat{\Delta}_t(x)$ of the suboptimality gaps $\Delta (x) = f(x^{*}) - f(x)$ for all $x\in \mathcal{X}$ . Let $\hat{x}_t^* = \arg \max_{x\in \mathcal{X}}\hat{f}_t(x)$ be the empirical estimate of the maximizer. Note that $\hat{x}_t^*$ is always defined, despite the fact that in general we can determine $\hat{f}_t$ only up to a constant shift (which does not affect the maximizer). Define + +$$ +\delta_ {t} \triangleq \max _ {z \in \mathcal {X}} \hat {f} _ {t} (z) - \hat {f} _ {t} (\hat {x} _ {t} ^ {*}) + \beta_ {t, \delta} ^ {1 / 2} \psi_ {t} (\hat {x} _ {t} ^ {*}, z) ^ {1 / 2}, +$$ + +where $\psi_t(x,z)$ is defined in (6). Intuitively, $\delta_t$ is the largest plausible regret that the learner can occur from playing $\hat{x}_t^*$ given the confidence estimates. The gap estimate is defined for any $x\in \mathcal{X}$ as follows: + +$$ +\hat {\Delta} _ {t} (x) \triangleq \delta_ {t} + \hat {f} _ {t} \left(\hat {x} _ {t} ^ {*}\right) - \hat {f} _ {t} (x). \tag {8} +$$ + +The gap estimate satisfies an upper bound on the true gaps, provided that (7) holds, as summarized in the next lemma. + +Lemma 1. With probability $1 - \delta$ , for all $x \in \mathcal{X}$ and $t \geq 1$ , + +$$ +\Delta (x) \leq 2 \hat {\Delta} _ {t} (x). +$$ + +Proof. With probability at least $1 - \delta$ + +$$ +\begin{array}{l} \Delta (x) = f \left(x ^ {*}\right) - f (x) \\ = \max _ {z \in \mathcal {X}} f (z) - f \left(\hat {x} _ {t} ^ {*}\right) + f \left(\hat {x} _ {t} ^ {*}\right) - f (x) \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {(i)} {\leq} \max _ {z \in \mathcal {X}} \hat {f} _ {t} (z) - \hat {f} _ {t} (\hat {x} _ {t} ^ {*}) + \beta_ {t, \delta} ^ {1 / 2} \psi_ {t} (z, \hat {x} _ {t} ^ {*}) ^ {1 / 2} \\ + \hat {f} _ {t} (\hat {x} _ {t} ^ {*}) - \hat {f} _ {t} (x) + \beta_ {t, \delta} ^ {1 / 2} \psi_ {t} (\hat {x} _ {t} ^ {*}, x) ^ {1 / 2} \\ \end{array} +$$ + +$$ +\stackrel {(i i)} {=} \hat {\Delta} _ {t} (x) + \beta_ {t, \delta} ^ {1 / 2} \psi_ {t} (\hat {x} _ {t} ^ {*}, x) ^ {1 / 2}. +$$ + +Here, $(i)$ uses (7) twice and $(ii)$ is by definition of $\hat{\Delta}_t(x)$ . On the other hand, + +$$ +\begin{array}{l} \hat {\Delta} _ {t} (x) = \max _ {z \in \mathcal {X}} \hat {f} _ {t} (z) - \hat {f} _ {t} (x) + \beta_ {t, \delta} ^ {1 / 2} \psi_ {t} (z, \hat {x} _ {t} ^ {*}) ^ {1 / 2} \\ \geq \beta_ {t, \delta} ^ {1 / 2} \psi_ {t} (\hat {x} _ {t} ^ {*}, x) ^ {1 / 2}. \\ \end{array} +$$ + +We used that $\psi_t(\hat{x}_t^*, x) = \psi_t(x, \hat{x}_t^*)$ in the last step. The claim follows with the last two displays combined. + +Note that this gap estimate is different from the choice proposed by Kirschner et al. (2020b), and importantly, allows us to reduce computational complexity. + +Information Gain IDS further requires an information gain function $I_{t}(x^{1}, x^{2})$ defined for each action, which in our case consists of an input pair, $x^{1}, x^{2} \in \mathcal{X}$ . Several choices were proposed by Kirschner et al. (2020b). Here we use the differential of the log-determinant potential, + +$$ +\begin{array}{l} I _ {t} \left(x ^ {1}, x ^ {2}\right) \triangleq \log \left(1 + \psi_ {t} \left(x ^ {1}, x ^ {2}\right)\right), \tag {9} \\ = \log \frac {\det (\mathbf {1} + K _ {t + 1})}{\det (\mathbf {1} + K _ {t})} \\ \end{array} +$$ + +This choice of information gain corresponds to the Bayesian mutual information $\mathbb{I}_t\big(d_t;f|(x_t^1,x_t^2) = (x^1,x^2)\big)$ in the Gaussian process model. In particular, the total information gain for (9) resembles the Gaussian entropy + +$$ +\gamma_ {n} = \sum_ {t = 1} ^ {n} I _ {t} \left(x _ {t} ^ {1}, x _ {t} ^ {2}\right) = \log \det \left(\mathbf {1} _ {n} + K _ {n + 1}\right). \tag {10} +$$ + +The log-determinant depends on the kernel function and upper bounds are known for many popular choices. For example, the linear kernel, $k(x,x^{\prime}) = \langle x,x^{\prime}\rangle$ , satisfies $\gamma_{n} \leq \mathcal{O}(d\log (n))$ and the RBF kernel, $k(x,x^{\prime}) = \exp (-\| x - x^{\prime}\|_{2}^{2} / 2)$ , satisfies $\gamma_{n} \leq \log (n)^{d + 1}$ (Srinivas et al., 2010, Theorem 5). + +Algorithm 1: Approx. IDS for Dueling Feedback +Input: Action set $\mathcal{X}$ , confidence coefficient $\beta_{t,\delta}(\delta)$ , DuelingFeedback $(x_t^1, x_t^2)$ , e.g. via (3) or (4) +1 for $t = 1, 2, 3, \ldots$ do +2 $\hat{x}_t^* \gets \arg \max_{x \in \mathcal{X}} \hat{f}_t(x)$ +3 $\hat{\Delta}_t(x) \gets \delta_t + \hat{f}_t(\hat{x}_t^*) - \hat{f}_t(x) \quad // Eq. (8)$ +4 $I_t(x) \gets \log(1 + \psi_t(\hat{x}_t^*, x)) \quad // Eq. (9)$ +5 $x_t, p \gets \arg \min_{x \in \mathcal{X}, p \in [0,1]} \frac{\left( (1 - p) \delta_t + p \hat{\Delta}_t(x) \right)^2}{p I_t(x)}$ +6 $B_t \sim Bernoulli(p)$ +7 if $B_t == 1$ , then +8 $(x_t^1, x_t^2) \gets (\hat{x}_t^*, x_t)$ +9 $d_t \gets$ DuelingFeedback $(x_t^1, x_t^2)$ +10 else +11 $(x_t^1, x_t^2) \gets (\hat{x}_t^*, \hat{x}_t^*) \quad // No feedback$ + +(Approximate) Information-Directed Sampling Given the gap estimate $\hat{\Delta}_t(x)$ and information gain $I_t(x^1, x^2)$ , we optimize the following trade-off jointly over $\mathcal{X} \times [0,1]$ , + +$$ +z _ {t}, p _ {t} \triangleq \underset {z \in \mathcal {X}, p \in [ 0, 1 ]} {\arg \min } \frac {\left((1 - p) \delta_ {t} + p \hat {\Delta} _ {t} (z)\right) ^ {2}}{p I _ {t} \left(\hat {x} _ {t} ^ {*} , z\right)}. \tag {11} +$$ + +Note that for fixed $z$ , the optimal trade-off probability is $p(z) = \min \left(\frac{\delta_t}{\hat{\Delta}_t(z) - \delta_t}, 1\right)$ . Consequently, IDS samples the pair $(\hat{x}_t^*, z_t)$ with probability $p_t$ , and otherwise, with probability $1 - p_t$ , the greedy pair $(\hat{x}_t^*, \hat{x}_t^*)$ . Note that choosing the same action for dueling feedback provides no information, and in particular the least-squares estimate remains unchanged. The approach is summarized in Algorithm 1. + +Computational Complexity As usual, computing the kernel estimates requires to invert the kernel matrix $K_{t}$ . With incremental updates, the exact kernel estimate and all related quantities can be computed in $\mathcal{O}(d^{2}n^{3})$ steps in total over $n$ rounds. Note that $\hat{x}_t^*$ and $\delta_t$ can be computed in $\mathcal{O}(|\mathcal{X}|)$ steps assuming that all kernel quantities have been pre-computed. The trade-off (11) can be computed in $\mathcal{O}(|\mathcal{X}|)$ steps, since it only requires to evaluate the gap estimates $\hat{\Delta}(x)$ and information gain $I_{t}(\hat{x}_{t}^{*}, x)$ for all $x \in \mathcal{X}$ . Therefore the overall complexity is $\mathcal{O}(d^{2}n^{3}|\mathcal{X}|)$ . Of course, Algorithm 1 can also be applied in the linear setting without kernelization, in which case the overall complexity is $\mathcal{O}(d^{2}n|\mathcal{X}|)$ . + +We remark that (11) is an approximation of the IDS trade-off proposed by Kirschner et al. (2020b), which requires to optimize a similar quantity over distributions $\mathcal{P}(\mathcal{X}\times \mathcal{X})$ . This is also possible, but the direct implementation suggested in (Kirschner et al., 2020b) requires $\mathcal{O}(|\mathcal{X}|^4)$ compute steps per round to calculate the gap estimates and to find the IDS distribution. + +# 4.1. Regret Bounds + +In the language of linear partial monitoring, theueling feedback (2) is a so-called locally observable game, which informally means that any reward difference $f(x) - f(x^{\prime})$ can be estimated from playing actions which have no more regret than playing either $x$ or $x^{\prime}$ alone (Kirschner et al., 2020b, Appendix C.5). Forueling bandits, IDS (without the approximation and sampling scheme that we introduce here) has regret at most $R_{n}\leq \mathcal{O}(\sqrt{n\beta_{n}\gamma_{n}})$ , see Kirschner et al. (2020b, Corollary 18). Here we show that Algorithm 1 satisfies a similar result. Note that the regret guarantee applies generally to settings with quantitativeueling feedback, where we define regret as follows: + +$$ +R _ {n} ^ {\text {d u e l}} = \sum_ {t = 1} ^ {n} \Delta \left(x _ {t} ^ {1}\right) + \Delta \left(x _ {t} ^ {2}\right). +$$ + +Theorem 1. For $\rho^2$ -sub-Gaussian dueling bandit feedback (2), Algorithm 1 satisfies with probability at least $1 - \delta$ + +$$ +R _ {n} ^ {\text {d u e l}} \leq \mathcal {O} \left(\sqrt {n \beta_ {n , \delta} \left(\gamma_ {n} + \log \frac {1}{\delta}\right)}\right). +$$ + +Note that the learner requires knowledge of the sub-Gaussian variance $\rho^2$ and the Hilbert norm bound $\|f\|_{\mathcal{H}} \leq B$ , which appear in the definition of the confidence coefficient $\beta_{n,\delta}$ . The regret guarantee has the same scaling as the best known bound for GP-UCB in standard Bayesian optimization (Srinivas et al., 2010; Chowdhury & Gopalan, 2017). Note that $\beta_{n,\delta} = \mathcal{O}\left(\gamma_n + \log \frac{1}{\delta}\right)$ hence combined with bounds for the total information gain $\gamma_n$ , we can derive bounds for specific choices of the kernel function. For example in the linear setting, we get $R_n^{dual} \leq \mathcal{O}\left(\rho \sqrt{n}(d\log(n) + \log\frac{1}{\delta})\right)$ , which is the same as for LinUCB (Abbasi-Yadkori et al., 2011). For the RBF kernel, we get $R_n^{dual} \leq \mathcal{O}\left(\rho \sqrt{n} (\log(n)^{2d+2} + \log\frac{1}{\delta})\right)$ . + +Applied to the confounded setting with either the one- or two-point reduction, we get the following result. Note that depending on whether the learner requires one or two evaluations per round, the timescale differs by a factor of two. + +Corollary 1. In the confounded setting (1) with $\sigma^2$ -sub-Gaussian observation noise and dueling feedback obtained via the one-point reduction (4), the regret of Algorithm 1 satisfies with probability at least $1 - \delta$ + +$$ +R _ {n} \leq \mathcal {O} \left(\left(C _ {\max } + \sigma\right) \sqrt {n \beta_ {n , \delta} \left(\gamma_ {n} + \log \frac {1}{\delta}\right)}\right), +$$ + +assuming that $\max_{t\in [n]}b_t\leq C_{\mathrm{max}}$ and the adversary is allowed to choose $b_{t}$ depending on all previous actions and observations, $\{x_s,y_s\}_{s = 1}^{t - 1}$ + +With the two-point reduction (3), Algorithm 1 satisfies with probability at least $1 - \delta$ , + +$$ +R _ {n} \leq \mathcal {O} \left(\left(D _ {\max } + \sigma\right) \sqrt {n \beta_ {n , \delta} \left(\gamma_ {n} + \log \frac {1}{\delta}\right)}\right), +$$ + +assuming that $\max_{t\in [n]}|b_{2t} - b_{2t + 1}|\leq D_{\mathrm{max}}$ and the adversary is allowed to choose $b_{t}$ depending on all but the last two actions and observations, $\{x_s,y_s\}_{s = 1}^{t - 2}$ . + +Note that the algorithm requires knowledge of the bound $C_{\mathrm{max}}$ or $D_{\mathrm{max}}$ respectively, which is needed to compute $\beta_{t,\delta}$ . This is in line with the previous work in the linear setting (Krishnamurthy et al., 2018; Kim & Paik, 2019). Removing or weakening this assumption is an interesting direction for future work. Note that in the linear case with the one-point reduction method, our regret bound is $R_n \leq \tilde{\mathcal{O}}(C_{\mathrm{max}} d\sqrt{n})$ , which matches the result by Krishnamurthy et al. (2018). The dependence on $d$ and $n$ cannot be improved even in the un-confounded linear bandit setting for general $\mathcal{X}$ (Lattimore & Szepesvári, 2020, Theorem 24.1). The results for the two-point reduction require a stronger assumption on the sequence $(b_t)_{t=1}^{2n}$ , but the regret only depends on the differences $|b_{2t} - b_{2t+1}|$ . Hence, the result assures sub-linear regret even for settings where the confounding terms are unbounded, for example when the objective function is subject to drift. + +Proof of Theorem 1. First, by Lemma 1 with probability at last $1 - \delta$ , $\Delta(x_{t}) \leq 2\hat{\Delta}_{t}(x_{t})$ . We extend the definition of the gap estimate to two points, $\hat{\Delta}_{t}(x^{1}, x^{2}) = \hat{\Delta}(x^{1}) + \hat{\Delta}(x^{2})$ . For a sampling distribution $\mu \in \mathcal{P}(\mathcal{X} \times \mathcal{X})$ , denote the expected gap $\hat{\Delta}_{t}(\mu) \triangleq \mathbb{E}_{x^{1}, x^{2} \sim \mu}[\hat{\Delta}_{t}(x^{1}, x^{2})]$ and the expected information gain $I_{t}(\mu) = \mathbb{E}_{x^{1}, x^{2} \sim \mu}[I_{t}(x^{1}, x^{2})]$ . The information ratio is defined as follows: + +$$ +\Psi_ {t} (\mu) \triangleq \frac {\hat {\Delta} _ {t} (\mu) ^ {2}}{I _ {t} (\mu)}. \tag {12} +$$ + +Let $(\mu_t)_{t=1}^n$ be the sequence of sampling distributions $\mu_t \in \mathcal{P}(\mathcal{X} \times \mathcal{X})$ defined by Algorithm 1, + +$$ +\mu_ {t} = (1 - p _ {t}) e _ {(\hat {x} _ {t} ^ {*}, \hat {x} _ {t} ^ {*})} + p _ {t} e _ {(\hat {x} _ {t} ^ {*}, z _ {t})}, +$$ + +where $e_x$ denotes a Dirac on $x \in \mathcal{X}$ . By (Lemma 1, Kirschner et al., 2020b), with probability $1 - \delta$ , + +$$ +R _ {n} ^ {\text {d u e l}} \leq \sqrt {\sum_ {t = 1} ^ {n} \Psi_ {t} (\mu_ {t}) \left(\gamma_ {n} + \mathcal {O} \left(\log \frac {1}{\delta}\right)\right)} + \mathcal {O} \left(\log \frac {n}{\delta}\right). +$$ + +The claim in the theorem follows if we show that the information ratio is bounded such that $\Psi_t(\mu_t) \leq \mathcal{O}(\beta_{n,\delta})$ . To this end, note that + +$$ +\begin{array}{l} \Psi_ {t} (\mu_ {t}) = \frac {\left((1 - p _ {t}) 2 \delta_ {t} + p _ {t} (\hat {\Delta} _ {t} (z _ {t}) + \delta_ {t})\right) ^ {2}}{p I _ {t} (\hat {x} _ {t} ^ {*} , z _ {t})} \\ \leq \min _ {x \in \mathcal {X}, p \in [ 0, 1 ]} \frac {4 \left((1 - p) \delta_ {t} + p \hat {\Delta} _ {t} (x)\right) ^ {2}}{p I _ {t} \left(\hat {x} _ {t} ^ {*} , x\right)} \\ \leq \min _ {x \in \mathcal {X}} \frac {4 \hat {\Delta} _ {t} (x) ^ {2}}{I _ {t} \left(\hat {x} _ {t} ^ {*} , x\right)}, \tag {13} \\ \end{array} +$$ + +where the first inequality follows from $\delta_t \leq \hat{\Delta}_t(x)$ and the definition of $z_t$ and $p_t$ , and the second inequality sets $p = 1$ . + +On the other hand, using that the kernel is bounded, $k(x,x)\leq 1$ , one easily checks that $\psi_t(x^1,x^2)\leq 4$ . With $a\leq 3\log (1 + a)$ for all $a\in [0,4]$ we find for $x^{1},x^{2}\in \mathcal{X}$ + +$$ +\psi_ {t} \left(x ^ {1}, x ^ {2}\right) \leq 3 \log \left(1 + \psi_ {t} \left(x ^ {1}, x ^ {2}\right)\right) = 3 I _ {t} \left(x ^ {1}, x ^ {2}\right). \tag {14} +$$ + +Next, define $\tilde{z}_t = \arg \max_{x\in \mathcal{X}}\hat{f}_t(x) + \beta_{t,\delta}^{1 / 2}\psi_t(\hat{x}_t,x)^{1 / 2}$ and observe that $\hat{\Delta}_{t}(\tilde{z}_{t}) = \beta_{t,\delta}^{1 / 2}\psi_{t}(\hat{x}_{t},\tilde{z}_{t})^{1 / 2}$ . The claim follows with (13) from noting that + +$$ +\Psi_ {t} (\mu_ {t}) \leq \frac {4 \hat {\Delta} _ {t} \left(\tilde {z} _ {t}\right) ^ {2}}{I _ {t} \left(\tilde {z} _ {t}\right)} \leq 1 2 \frac {\beta_ {t , \delta} \psi_ {t} \left(\hat {x} _ {t} , \tilde {z} _ {t}\right)}{\psi_ {t} \left(\hat {x} _ {t} , \tilde {z} _ {t}\right)} = 1 2 \beta_ {t, \delta}. \tag {15} +$$ + +The result follows from the fact that $\beta_{t,\delta}$ is monotonically increasing. + +Algorithm 1 also satisfies a gap-dependent bound for finite action sets $\mathcal{X}$ . Let $\Delta_{\mathrm{min}} = \min_{x \neq x^*} \Delta(x)$ be the smallest non-zero gap and assume that $x^*$ is unique. The theorem applies to the confounded setting via the reduction method similar to Corollary 1. + +Theorem 2. Assuming that $x^{*}$ is unique, the regret of Algorithm 1 satisfies with probability at least $1 - \delta$ , + +$$ +R _ {n} ^ {\text {d u e l}} \leq \mathcal {O} \left(\Delta_ {\min } ^ {- 1} \beta_ {n, \delta} \left(\gamma_ {n} + \log \frac {n}{\delta}\right)\right). +$$ + +For linear bandits, the regret bound reads $R_{n}^{dual} \leq \mathcal{O}(\Delta_{\min}^{-1} d^{2} \log(n)^{2})$ and for the RKHS setting with RBF kernel, the bound is $R_{n}^{dual} \leq \mathcal{O}(\Delta_{\min}^{-1} \log(n)^{2d+2})$ . + +Proof of Theorem 2. Our proof uses the strategy introduced by Kirschner et al. (2020c) that relies on finding an instance-dependent bound on the information ratio. Let $\Psi_t(\mu_t)$ be the information ratio defined in (12). We apply (Kirschner et al., 2020b, Lemma 1 with $\eta = 0$ ) to the scaled information gain $\tilde{I}_t = \beta_{t,\delta}I_t$ , to find with probability $1 - \delta$ + +$$ +\sum_ {t = 1} ^ {n} \hat {\Delta} _ {t} \left(x _ {t} ^ {1}, x _ {t} ^ {2}\right) \leq \sqrt {\sum_ {t = 1} ^ {n} \frac {\Psi_ {t} \left(\mu_ {t}\right)}{\beta_ {t , \delta}} \left(\beta_ {n , \delta} \left(\gamma_ {n} + \mathcal {O} \left(\log \frac {n}{\delta}\right)\right)\right)} +$$ + +We condition now on the event that the previous equation and the confidence estimate in (7) hold simultaneously. As before, let $\tilde{z}_t = \arg \max_{x\in \mathcal{X}}\hat{f}_t(x) + \beta_{t,\delta}^{1 / 2}\psi_t(\hat{x}_t,x)^{1 / 2}$ . We may assume that $\tilde{z}_t\neq \hat{x}_t$ , since otherwise $\delta_t = 0$ and therefore $\Psi_t(\mu_t) = 0$ . On the other hand, this implies that $2\hat{\Delta}_{t}(\tilde{z}_{t})\geq \Delta_{\mathrm{min}}$ by (1) and using that $x^{*}$ is unique. + +Next, we reuse the inequality leading to (13) to find + +$$ +\Psi_ {t} (\mu_ {t}) \leq \min _ {p \in [ 0, 1 ]} \frac {4 \left((1 - p) \delta_ {t} + p \hat {\Delta} _ {t} (\tilde {z} _ {t})\right) ^ {2}}{p I _ {t} (\hat {x} _ {t} , \tilde {z} _ {t})}. +$$ + +First, consider the case where $2\delta \leq \hat{\Delta}_t(\tilde{z}_t)$ . Computing the minimizer of the previous display and using (14), we find + +$$ +\Psi_ {t} (\mu_ {t}) \leq \frac {1 6 \delta_ {t} \hat {\Delta} _ {t} (\tilde {z} _ {t})}{I _ {t} (\hat {x} _ {t} , \tilde {z} _ {t})} \leq \frac {4 8 \delta_ {t} \beta_ {t , \delta}}{\hat {\Delta} _ {t} (\tilde {z} _ {t})} \leq \frac {9 6 \delta_ {t} \beta_ {t , \delta}}{\Delta_ {\mathrm {m i n}}}. +$$ + +For the other case where $2\delta_{t} > \hat{\Delta}_{t}(\tilde{z}_{t})$ , using (15) directly gives + +$$ +\Psi_ {t} (\mu_ {t}) \leq 1 2 \beta_ {t, \delta} \leq \frac {2 4 \delta_ {t} \beta_ {t , \delta}}{\hat {\Delta} _ {t} (\tilde {z} _ {t})} \leq \frac {4 8 \delta_ {t} \beta_ {t , \delta}}{\Delta_ {\min }}. +$$ + +Finally, note that $\delta_t \leq \frac{1}{2} \hat{\Delta}_t(x_t^1, x_t^2)$ . Using the bound on the information ratio, and solving for the regret, we find + +$$ +\sum_ {t = 1} ^ {n} \hat {\Delta} _ {t} \left(x _ {t} ^ {1}, x _ {t} ^ {2}\right) \leq \mathcal {O} \left(\Delta_ {\min } ^ {- 1} \beta_ {n, \delta} \left(\gamma_ {n} + \log \frac {n}{\delta}\right)\right). +$$ + +The claim follows with Lemma 1 by noting that, + +$$ +R _ {n} ^ {\text {d u e l}} \leq \sum_ {t = 1} ^ {n} 2 \hat {\Delta} _ {t} \left(x _ {t} ^ {1}, x _ {t} ^ {2}\right). +$$ + +![](images/c3821c6b124f2558947e37477a94985a1801ba6c237d8b343d968db48e71d9d5.jpg) + +# 4.2. A Connection to Doubly-Robust Estimation + +In the finite-dimensional, linear case, the objective function is $f(x) = \langle x,\theta \rangle$ for a fixed parameter $\theta \in \mathbb{R}^d$ . To obtain an estimate $\hat{\theta}_t$ of the unknown parameter $\theta$ directly from confounded data $\{(x_s,y_s = \langle x_s,\theta \rangle +b_s + \epsilon_s)\}_{s = 1}^{t - 1}$ , Krishnamurthy et al. (2018) use a randomized policy $x_{t}\sim \mu_{t}$ and a doubly-robust estimation approach. For centered feature vectors $\bar{x}_t = \mathbb{E}_{x\sim \mu_t}[x]$ and regularizer $\lambda >0$ , they define + +$$ +\Gamma_ {t} \triangleq \sum_ {s = 1} ^ {t - 1} \left(x _ {t} - \bar {x} _ {t}\right) \left(x _ {t} - \bar {x} _ {t}\right) ^ {\top} + \lambda \mathbf {1} _ {d}, +$$ + +$$ +\hat {\theta} _ {t} \triangleq \Gamma_ {t} ^ {- 1} \sum_ {s = 1} ^ {t - 1} \left(x _ {t} - \bar {x} _ {t}\right) y _ {t}. \tag {16} +$$ + +They further derive the following high-probability bound for doubly-robust estimator: + +$$ +\left\| \hat {\theta} _ {t} - \theta \right\| _ {\Gamma_ {t}} ^ {2} \leq \mathcal {O} (d \log (n) + \log (n / \delta) + \lambda). \tag {17} +$$ + +Interestingly, when $\mu_t = \mathrm{Uniform}(\{x^1, x^2\})$ is chosen to randomize between two actions $x^1, x^2 \in \mathcal{X}$ , then this estimator coincides with the least-squares estimator that we obtain for the dueling bandit feedback. This follows immediately from noting that $2(x_t - \bar{x}_t) = x^1 - x^2$ . Further, the concentration bounds are on the same quantity, but the reduction avoids the detour to prove the (more general) concentration bound (17) and leads tighter bounds. We remark that in general, the BOSE algorithm by Krishnamurthy et al. (2018) requires to compute a sampling distributions $\mu_t$ supported on $d + 1$ points. We also note that Kim & Paik (2019) propose another variant of the doubly-robust estimator (16). This estimator coincides with our estimation scheme in the same way. + +![](images/f5beca59ea8c55dd7c7661bd0e169366a74c00008785f60c6ca56f18e30ad50d.jpg) +Figure 1. Benchmarks with randomly sampled action sets of size 20 and $d = 4$ . The confidence region shows $2 \times$ standard error over 50 repetition. Without confounding, UCB performs best, and is closely followed by IDS and Semi-TS. With additive bias the performance of UCB degrades significantly, whereas the robust methods maintain sublinear regret. Note that in the drift experiment (bottom left), the bias is unbounded, which leads to linear regret for all methods except IDS-two. With bounded bias (right column), IDS-one and Semi-TS show similar performance, whereas the performance of IDS-two is varying. The BOSE algorithm shows sublinear behavior but is much more conservative. + +# 5. Experiments + +We evaluate the proposed method with the one-point reduction (IDS-one) and the two-point reduction (IDS-two) in two numerical experiments with confounded observations. To allow a fair comparison with the two-sample scheme, we account for the regret of both evaluations and scale the x-axis appropriately. + +# 5.1. Baselines + +UCB For the linear setting, LinUCB (Auer, 2003) is implemented as in (Abbasi-Yadtori et al., 2011, Figure 1) using a regularizer $\lambda = 1$ and confidence coefficient $\beta_{t,\delta}^{1/2} = \sqrt{\log\det V_t + 2\log\frac{1}{\delta}} + 1$ . In the kernelized setting, we use GPUCB (Srinivas et al., 2010) with an empirically tuned confidence coefficient $\beta_{n,\delta} = 1$ . As shown by Bogunovic et al. (2020a), increasing the confidence coefficient to a larger value as required in the stochastic setting can lead to better robustness, although we did not see an improvement of performance in our experiments. + +BOSE The BOSE algorithm (Krishnamurthy et al., 2018, Algorithm 1) uses the doubly-robust least-squares estimator + +![](images/7e104aa1c6f33e871dd043f67029a4766f6ab697a6232aee48bc487b0a489268.jpg) +Figure 2. Performance of kernelized algorithms on the camelback benchmark. The confidence region shows $2 \times$ standard error over 50 repetitions. With bounded confounding that simulates a recalibration process (left), GP-UCB is surprisingly competitive with IDS-two, followed by IDS-one. When the feedback is confounded by an unbounded, periodic drift (right), we observe linear regret of GP-UCB and IDS-one (because the bias is unbounded), whereas IDS-two maintains good performance despite the confounding. + +(16). We set the required concentration coefficient $\beta_{t,\delta}^{\mathrm{DR}}$ to + +$$ +\beta_ {t, \delta} ^ {\mathrm {D R}} = \sqrt {d \log (1 + t / d) + 2 \log \left(\frac {t}{\delta}\right)} + 1, +$$ + +where we drop (conservative) constants required for the theoretical results in favor of better empirical performance. BOSE requires to solve a convex-quadratic feasibility problem on the space of sampling distributions over the remaining plausible actions, and no specific computation method was recommended by the authors. We compute the sampling distribution by solving the saddle point problem stated in (Krishnamurthy et al., 2018, Appendix D) using exponentiated gradient descent. + +SemiTS The semi-parametric Thompson sampling is implemented as in (Kim & Paik, 2019, Algorithm 1), with a less conservative over-sampling parameter $v = \sqrt{2\log(t / \delta)}$ . Our choice improves performance over the theoretical value. We also remark that SemiTS requires to compute the probability of each action being optimal under a Gaussian perturbation of the mean parameter. We do so by computing the empirical sampling probabilities from 1000 random samples per round, the alternative being to compute Gaussian integrals over $d$ -dimensional polytopes $\mathcal{C}_x = \{\nu \in \mathbb{R}^d : \langle x, \nu \rangle \geq \max_{x' \in \mathcal{X}} \langle x', \nu \rangle\}$ . While SemiTS is significantly faster than BOSE in our implementation, computing the posterior probabilities accurately for larger action sets remains challenging. + +In all experiments we set confidence level $\delta = 0.05$ . + +# 5.2. Environments + +Linear Reward In the first experiment, we use a linear reward function $f(x) = \langle x, \theta \rangle$ . For each repetition we sample $k = 20$ actions uniformly on the $d = 4$ dimensional + +unit sphere. We add Gaussian observation noise with variance $\sigma^2 = 1$ , that is $\epsilon_t \sim \mathcal{N}(0,1)$ in (1). In this setting we compare to BOSE, SemiTS and LinUCB (Auer, 2003; Abbasi-Yadkori et al., 2011), where the latter does not directly deal with the confounding. We consider four different types of confounding: a) no bias; b) the adversary repeats the last observation with a minus sign, $b_{t} = -y_{t - 1}$ , which makes it much harder to identify the best action (negative repeat); c) a continues drift, $b_{t} = -0.1t$ , i.e. unbounded confounding; and d) same as the previous, but with compensated drift, $b_{t} = -0.1t + y_{t - 1}$ , thereby making the bias terms bounded but dependent on the previous observation. + +The result is shown in Figure 1. As expected, in the unconfounded setting UCB works best, followed by both IDS variants and SemiTS with reasonable performance. With confounding, the regret of UCB is increased by a lot, whereas BOSE shows sublinear behaviour but is relatively inefficient. In the example with unbounded bias (drift) only IDS-two performs well, as in fact the theoretical assumptions for all other methods are invalidated. With bounded bias (i.e. negative repeat and compensated drift), SemiTS and IDS-one are competitive, while IDS-two clearly outperforms the baselines in the negative repeat experiment. + +Camelback Our second experiment is in the non-linear, kernelized setting with observation noise variance $\sigma^2 = 0.1$ . As benchmark we choose the camelback function on the domain $[-2,2] \times [-1,1]$ , + +$$ +\begin{array}{l} f (x _ {1}, x _ {2}) = \\ - \min \left(x _ {1} ^ {2} \left(4 - 2. 1 x _ {1} ^ {2} + \frac {x _ {1} ^ {4}}{3 .}\right) + x _ {1} x _ {2} + x _ {2} ^ {2} \left(4 x _ {2} ^ {2} - 4\right), 2. 5\right) \\ \end{array} +$$ + +We discretize the input space using 30 points per dimension. The only direct competitor that we are aware of is the method of Bogunovic et al. (2020a). This method is, however, equivalent to GP-UCB (Srinivas et al., 2010) with an up-scaled confidence coefficient. This suggests that the UCB approach is inherently robust up to a certain degree of corruption, which is also visible in our experiment. For both algorithms, we use an RBF kernel with lengthscale 0.2 and regularizer $\lambda = 1$ , and set $\beta_{n,\delta} = 1$ in favor of better empirical performance. We use two types of confounding that we expect is relevant in applications: $a$ ) a calibration process, which monitors a moving average over the last 10 observations and adjusts the output range to $[-0.1, 0.1]$ whenever the average is no longer in this range; and $b$ ) periodic drift of the objective, $b_{t} = \sin(0.2t) - 0.1t$ . Results are shown in Figure 2. In the first variant GPUCB works surprisingly well despite the confounding and is on-par with IDS-two. With unbounded drift, both GPUCB and IDS-one obtain linear regret, whereas the performance of IDS-two in unaffected. + +# 6. Conclusion + +We introduced randomized evaluation schemes based on pair-wise comparisons that makeueling bandit algorithms applicable to robust optimization with additive confounding. Moreover, we derived a kernelizedueling bandit algorithm based on recent ideas by Kirschner et al. (2020b). The resulting algorithm satisfies worst-case and gap-dependent regret bounds on the cumulative regret and could be of broader interest in theueling bandit setting. Our numerical experiments validate the theoretical findings. + +# Acknowledgements + +This research has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme grant agreement No 815943. + +# References + +Abbasi-Yadkori, Y. Online Learning for Linearly Parametrized Control Problems. PhD thesis, 2012. +Abbasi-Yadkori, Y., Pál, D., and Szepesvári, C. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pp. 2312-2320, 2011. +Abe, N. and Long, P. M. Associative reinforcement learning using linear probabilistic concepts. In Proceedings of the Sixteenth International Conference on Machine Learning, ICML '99, pp. 3-11, San Francisco, CA, USA, 1999. Morgan Kaufmann Publishers Inc. ISBN 1-55860-612-2. +Agarwal, A., Agarwal, S., and Patil, P. Stochastic dueling bandits with adversarial corruption. In Algorithmic Learning Theory, pp. 217-248. PMLR, 2021. +Auer, P. Using confidence bounds for exploitation-exploration trade-offs. J. Mach. Learn. Res., 3:397-422, March 2003. ISSN 1532-4435. +Bengs, V., Busa-Fekete, R., El Mesaoudi-Paul, A., and Hüllermeier, E. Preference-based online learning with dueling bandits: A survey. Journal of Machine Learning Research, 22(7):1-108, 2021. +Bogunovic, I., Scarlett, J., Jegelka, S., and Cevher, V. Adversarily robust optimization with gaussian processes. arXiv preprint arXiv:1810.10775, 2018. +Bogunovic, I., Krause, A., and Scarlett, J. Corruption-tolerant gaussian process bandit optimization. In International Conference on Artificial Intelligence and Statistics, pp. 1071-1081. PMLR, 2020a. + +Bogunovic, I., Losalka, A., Krause, A., and Scarlett, J. Stochastic linear bandits robust to adversarial attacks. arXiv preprint arXiv:2007.03285, 2020b. +Bull, A. D. Convergence rates of efficient global optimization algorithms. Journal of Machine Learning Research, 12(10), 2011. +Chowdhury, S. R. and Gopalan, A. On kernelized multiarmed bandits. In International Conference on Machine Learning, 2017. +Dani, V., Hayes, T. P., and Kakade, S. M. Stochastic Linear Optimization under Bandit Feedback. In $COLT$ , pp. 355-366. Omnipress, 2008. +Duris, J., Kennedy, D., Hanuka, A., Shtalenkova, J., Edelen, A., Baxevanis, P., Egger, A., Cope, T., McIntire, M., Ermon, S., et al. Bayesian optimization of a free-electron laser. Physical review letters, 124(12):124801, 2020. +Frazier, P. I. A tutorial on bayesian optimization. arXiv preprint arXiv:1807.02811, 2018. +Gupta, A., Koren, T., and Talwar, K. Better algorithms for stochastic bandits with adversarial corruptions. In Conference on Learning Theory, pp. 1562-1578. PMLR, 2019. +Juranic, P., Rehanek, J., Arrell, C. A., Pradervand, C., Ischebeck, R., Erny, C., Heimgartner, P., Gorgisyan, I., Thominet, V., Tiedtke, K., et al. Swissfel aramis beamline photon diagnostics. Journal of synchrotron radiation, 25(4):1238-1248, 2018. +Kandasamy, K., Schneider, J., and Poczos, B. High dimensional bayesian optimisation and bandits via additive models. In International conference on machine learning, pp. 295-304. PMLR, 2015. +Kim, G.-S. and Paik, M. C. Contextual multi-armed bandit algorithm for semiparametric reward model. In International Conference on Machine Learning, pp. 3389-3397, 2019. +Kirschner, J., Mutny, M., Hiller, N., Ischebeck, R., and Krause, A. Adaptive and safe bayesian optimization in high dimensions via one-dimensional subspaces. In International Conference on Machine Learning, pp. 3429-3438, 2019. +Kirschner, J., Bogunovic, I., Jegelka, S., and Krause, A. Distributionally robust bayesian optimization. In International Conference on Artificial Intelligence and Statistics, pp. 2174-2184. PMLR, 2020a. +Kirschner, J., Lattimore, T., and Krause, A. Information directed sampling for linear partial monitoring. volume + +125 of Proceedings of Machine Learning Research, pp. 2328-2369. PMLR, 09-12 Jul 2020b. +Kirschner, J., Lattimore, T., Vernade, C., and Szepesvári, C. Asymptotically optimal information-directed sampling. arXiv preprint arXiv:2011.05944, 2020c. +Krishnamurthy, A., Wu, Z. S., and Syrgkanis, V. Semiparametric contextual bandits. In International Conference on Machine Learning, pp. 2776-2785, 2018. +Lattimore, T. and Szepesváři, C. Bandit algorithms. Cambridge University Press, 2020. +Li, Y., Lou, E. Y., and Shan, L. Stochastic linear optimization with adversarial corruption. arXiv preprint arXiv:1909.02109, 2019. +Lin, T., Abrahao, B., Kleinberg, R., Lui, J., and Chen, W. Combinatorial partial monitoring game with linear feedback and its applications. In International Conference on Machine Learning, pp. 901-909, 2014. +Liu, G. and Lai, L. Action-manipulation attacks on stochastic bandits. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3112-3116. IEEE, 2020. +Lykouris, T., Mirrokni, V., and Paes Leme, R. Stochastic bandits robust to adversarial corruptions. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pp. 114-122, 2018. +Mockus, J. The bayesian approach to global optimization. System Modeling and Optimization, pp. 473-481, 1982. +Russo, D. and Van Roy, B. Learning to optimize via information-directed sampling. In Advances in Neural Information Processing Systems, pp. 1583-1591, 2014. +Saha, A. and Gopalan, A. Regret minimization in stochastic contextual dueling bandits. arXiv preprint arXiv:2002.08583, 2020. +Shahriari, B., Swersky, K., Wang, Z., Adams, R. P., and de Freitas, N. Taking the human out of the loop: A review of bayesian optimization. Proceedings of the IEEE, 104 (1):148-175, 2016. +Sorokin, A. A., Bican, Y., Bonfigt, S., Brachmanski, M., Braune, M., Jastrow, U. F., Gottwald, A., Kaser, H., Richter, M., and Tiedtke, K. An x-ray gas monitor for free-electron lasers. Journal of synchrotron radiation, 26 (4):1092-1100, 2019. +Srinivas, N., Krause, A., Kakade, S. M., and Seeger, M. Gaussian process optimization in the bandit setting: No regret and experimental design. International Conference on Machine Learning, 2010. + +Sui, Y., Yue, Y., and Burdick, J. W. Correlational dueling bandits with application to clinical treatment in large decision spaces. arXiv preprint arXiv:1707.02375, 2017a. +Sui, Y., Zhuang, V., Burdick, J. W., and Yue, Y. Multidueling bandits with dependent arms. arXiv preprint arXiv:1705.00253, 2017b. +Sui, Y., Zoghi, M., Hofmann, K., and Yue, Y. Advancements in dueling bandits. In IJCAI, pp. 5502-5510, 2018. +Tewari, A. and Murphy, S. A. From ads to interventions: Contextual bandits in mobile health. In Mobile Health, pp. 495-517. Springer, 2017. +Xu, Y., Joshi, A., Singh, A., and Dubrawski, A. Zeroth order non-convex optimization with dueling-choice bandits. In Conference on Uncertainty in Artificial Intelligence, pp. 899–908. PMLR, 2020. +Yue, Y. and Joachims, T. Interactively optimizing information retrieval systems as a dueling bandits problem. In Proceedings of the 26th Annual International Conference on Machine Learning, pp. 1201-1208, 2009. +Yue, Y., Broder, J., Kleinberg, R., and Joachims, T. The k-armed dueling bandits problem. Journal of Computer and System Sciences, 78(5):1538-1556, 2012. \ No newline at end of file diff --git a/biasrobustbayesianoptimizationviaduelingbandits/images.zip b/biasrobustbayesianoptimizationviaduelingbandits/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4c6026ec4669209d2237de5fca4f2d267395ae5e --- /dev/null +++ b/biasrobustbayesianoptimizationviaduelingbandits/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1924406f8e50b4b6e5acb5c674c068f66e34876f56240e50d60ad3fd68d8d8b7 +size 360017 diff --git a/biasrobustbayesianoptimizationviaduelingbandits/layout.json b/biasrobustbayesianoptimizationviaduelingbandits/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..564fe850a2d1abe8af86b6cdb9d335d9eab74617 --- /dev/null +++ b/biasrobustbayesianoptimizationviaduelingbandits/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77910a329a10cbc45e277d032d9be9fbfa084ae9d43b0d8200f943a9c7bd67d4 +size 602489 diff --git a/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_content_list.json b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e56d220b70ed6c935e56f702a993d62608542154 --- /dev/null +++ b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21c177f61534fdd2ff782722cfc2e08f1a8fba74975f45ddc44a7f22f6a86f10 +size 84399 diff --git a/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_model.json b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1cbafa2112634ab52ccd8bbf1a5f6ce135d8d8eb --- /dev/null +++ b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afeef75f4d9d2d9cc81043f594b404fa5b58de484e7c9dfc9274cdb229456140 +size 103519 diff --git a/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_origin.pdf b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1c7fd3925fb22da96f98217a3bf0a89da8516701 --- /dev/null +++ b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/989f6557-4fb2-4cd0-84df-4c8e3976255b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d1d251d6f223cd2c138857454997a68bf6023c367ad6e77a8a7019473c59f66 +size 8955308 diff --git a/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/full.md b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..efdb78c510f4dab0a7f2440a099be3c6f68433df --- /dev/null +++ b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/full.md @@ -0,0 +1,393 @@ +# Bias-Variance Reduced Local SGD for Less Heterogeneous Federated Learning + +Tomoya Murata $^{1,2}$ Taiji Suzuki $^{2,3}$ + +# Abstract + +Recently, local SGD has got much attention and been extensively studied in the distributed learning community to overcome the communication bottleneck problem. However, the superiority of local SGD to minibatch SGD only holds in quite limited situations. In this paper, we study a new local algorithm called Bias-Variance Reduced Local SGD (BVR-L-SGD) for nonconvex distributed optimization. Algorithmically, our proposed bias and variance reduced local gradient estimator fully utilizes small second-order heterogeneity of local objectives and suggests randomly picking up one of the local models instead of taking the average of them when workers are synchronized. Theoretically, under small heterogeneity of local objectives, we show that BVR-L-SGD achieves better communication complexity than both the previous non-local and local methods under mild conditions, and particularly BVR-L-SGD is the first method that breaks the barrier of communication complexity $\Theta(1/\varepsilon)$ for general nonconvex smooth objectives when the heterogeneity is small and the local computation budget is large. Numerical results are given to verify the theoretical findings and give empirical evidence of the superiority of our method. + +# 1. Introduction + +Nowadays, optimization problems arising in machine learning are often large and require huge computational time. Distributed learning is one of the attractive approaches to reduce the computational time by utilizing parallel computing. In classical distributed learning, each worker has the whole dataset used in optimization or a random sub + +$^{1}$ NTT DATA Mathematical Systems Inc., Tokyo, Japan $^{2}$ Graduate School of Information Science and Technology, The University of Tokyo, Tokyo, Japan $^{3}$ Center for Advanced Intelligence Project, RIKEN, Tokyo, Japan. Correspondence to: Tomoya Murata , Taiji Suzuki . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +set of the whole dataset which is not explicitly exchanged. In recent federated learning, introduced by Konečný et al. (2015); Shokri & Shmatikov (2015); McMahan et al. (2017), we build a global model across multiple devices or servers without explicitly exchanging their own local datasets, and local datasets can be heterogeneous, i.e., each local dataset may be generated from a different distribution. There are various federated learning scenarios (e.g., personalization, preservation of the privacy of local information, robustness to attacks and failures, guarantees of fairness) and refer to the extensive survey (Kairouz et al., 2019) for these topics. + +One of the most naive and widely used approaches to distributed learning is minibatch Stochastic Gradient Descent (SGD) (Dekel et al., 2012), which is also called as Federated Averaging (FedAvg) (McMahan et al., 2017). Each worker computes minibatch stochastic gradient of the own local objective and then their average is used to update the global model. Also, more computationally efficient methods including minibatch Stochastic Variance Reduced Gradient (SVRG) (Johnson & Zhang, 2013; Allen-Zhu & Hazan, 2016; Reddi et al., 2016a) and its variant (Lei et al., 2017), minibatch StochAstic Recursive grAdient algorithmHm (SARAH) (Nguyen et al., 2017; 2019) and its variants (Fang et al., 2018; Zhou et al., 2018) are applicable to the problem. Particularly, SARAH achieves the optimal total computational complexity in nonconvex optimization. + +Unfortunately, minibatch methods suffer from their communication cost because of the necessity to communicate local gradients for every single global update. One of the possible solutions is using a large batch to compute local gradients (Goyal et al., 2017), but the communication complexity, that is the necessary number of communication rounds to optimize, is theoretically never smaller than the one of deterministic GD and thus communication cost is still problematic. + +To overcome the communication bottleneck problem, local methods have got much attention due to its empirical effectiveness (Konečný et al., 2015; Lin et al., 2018). In local SGD (also called Parallel Restart SGD), each worker independently updates the local model based on his own local dataset, and periodically communicates and averages the local models. Many papers (Stich, 2018; Yu et al., 2019; Haddadpour & Mahdavi, 2019; Haddadpour et al., 2019; + +Koloskova et al., 2020; Khaled et al., 2020) have stated the superiority of local SGD to minibatch SGD, but these results are based on unfair comparisons and hence not satisfactory. Concretely, they have compared the two algorithms with the same local minibatch size $b$ , which means that local SGD with $K$ local updates requires $K$ times larger number of local computations per communication round than minibatch SGD. $^{1}$ If we fix the number of single stochastic gradient computations per communication round to $\mathcal{B} := Kb$ for each worker, their results indicate that the communication complexity of local SGD with $K$ local updates and $b$ local minibatch size are never better than the one of minibatch SGD with $\mathcal{B}$ local minibatch size for any $\mathcal{B}$ . This point is quite important, but many papers have overlooked it. + +Recently, Woodworth et al. (2020b;a) have shown that, for the first time, theoretical superiority of local SGD to minibatch SGD under fair comparison for convex optimization when the heterogeneity of local objectives is small. On the other hand, their derived lower bound of local SGD also suggests the limitation of local SGD. Specifically, they have shown that if the first-order heterogeneity of local objectives $^{2}$ is greater than $\sqrt{\varepsilon}$ , where $\varepsilon$ is the desired optimization accuracy, the communication complexity of local SGD is even worse than the one of minibatch SGD. In other words, the quite small heterogeneity of local objectives is essential for the superiority of local SGD to minibatch SGD, which is a clear limitation of local SGD. SCAFFOLD (Karimireddy et al., 2020b) is a new local algorithm based on the idea of reducing their called client-drift, which uses a similar formulation to the variance reduction technique. However, the communication complexity is the same as minibatch SGD for general nonconvex objectives and it requires small heterogeneity and quadraticity of local objectives to surpass minibatch SGD, which is also quite limited. Inexact DANE (Reddi et al., 2016b) is another variant of local methods that uses a general local subsolver that returns an approximate minimizer of the regularized local objective. Again, the superiority to non-local methods has been only shown for quadratic convex objectives. + +In summary, both in classical distributed learning and recent federated learning, naive minibatch (i.e., non-local) methods often suffer from their communication cost. Several local methods surpass non-local ones in terms of communication complexity. However, the necessary conditions for the superiority of the previous local algorithms to non-local ones are quite limited (i.e., extremely small heterogeneity + +or quadraticity of local objectives). A natural question is that: is there a local algorithm which surpasses non-local (and existing local) ones in terms of communication complexity with a fixed local computation budget under more relaxed conditions? + +# Main Contributions + +We propose a new local algorithm called Bias-Variance Reduced Local SGD (BVR-L-SGD) for nonconvex distributed learning. The main features of our method are as below. + +Algorithmic Features. The algorithm is based on our bias and variance reduced gradient estimator that simultaneously reduces the bias caused by local updates and the variance caused by stochasticization based on the idea of SARAH like variance reduction technique. Importantly, to fully utilize the second-order heterogeneity of local objectives, a randomly picked local model is used as a synchronized global model instead of taking the average of them, which is typical in the previous local methods. + +Theoretical Features. We analyse BVR-L-SGD for general nonconvex smooth objectives under second-order heterogeneity assumption, which interpolates the heterogeneity of local objectives between the identical case and the extremely non-III case, and plays a critical role in our nonconvex analysis. The comparison of the communication complexities of our method with the most relevant existing results is given in Table 1. The communication complexity of BVR-L-SGD has a better dependence on $\varepsilon$ than minibatch SGD, local SGD and SCAFFOLD. When $\mathcal{BP} \gg \sqrt{n \wedge 1 / \varepsilon}$ and the second-order heterogeneity $\zeta$ of local objectives is small relative to the smoothness $L$ , BVR-L-SGD strictly surpasses minibatch SARAH. Furthermore, BVR-L-SGD is the first method that breaks the barrier of communication complexity $1 / \varepsilon$ when local computation budget $\mathcal{B} \to \infty$ , for general smooth nonconvex objectives with small heterogeneity $\zeta$ . Importantly, even when the heterogeneity is high, the communication complexity of our method is never worse than the ones of the existing methods since the second-order heterogeneity $\zeta$ is bounded by two times the smoothness $L$ of local objectives4. + +As a result, BVR-L-SGD is a novel and promising communication efficient method for nonconvex optimization both in classical distributed learning (i.e., local data distributions are nearly identical) and recent federated learning (i.e., local data distributions can be highly heterogeneous). + +
AlgorithmCommunication ComplexityExtra Assumptions
Minibatch SGD1/ε + 1/BPε2None
Minibatch SARAH (Nguyen et al., 2019)1/ε + √n ∧ 1/BPεNone
Local SGD (Yu et al., 2019)1/Bε + 1/BPε2 + 1/ε3G gradient boundedness
Local SGD (Khaled et al., 2020)31+σdif/dif/BPε2 + σdif2dBp/εconvexity +B ≤ 1+σdif/dif or σdif2≥ε
Local SGD (Woodworth et al., 2020a)1/Bε + 1/BPε2 + 1/√Bε3/2 + ζ1/ε3convexity, +1st-order ζ1 heterogeneity
Local SGD (Woodworth et al., 2020a) +(Lower bound)1/Bε3/2 + 1/BPε2 + (1/ε ∧ ζ1/ε3)convexity, +1st-order ζ1 heterogeneity
SCAFFOLD (Karimireddy et al., 2020b)1/ε + 1/BPε2None
SCAFFOLD (Karimireddy et al., 2020b)1/Bε + 1/BPε2 + ζ/εquadraticity, +2nd-order ζ heterogeneity
BVR-L-SGD (this paper)1/√Bε + √n ∧ 1/BPε + ζ/ε2nd-order ζ heterogeneity
+ +Table 1. Comparison of the order of the necessary number of communication rounds to satisfy $\mathbb{E}\| f(x_{\mathrm{out}})\| ^2\leq \varepsilon$ (or $f(x_{\mathrm{out}}) - f(x_{*})\leq \varepsilon$ for convex $f$ ). "Extra Assumptions" indicates the necessary assumptions to derive the results other than Assumptions 2, 3 and 4 in Section 2. $\varepsilon$ is the desired optimization accuracy. $\mathcal{B}$ is the local computation budget that is the allowed number of single stochastic gradient computations per communication round for each worker. $P$ is the number of workers. $n$ is the total number of samples and is possibly $\infty$ in online (i.e., expected risk minimization) settings. The smoothness of local objectives $L$ , the variance of a single stochastic gradient $\sigma^2$ and gradient boundedness $G$ are regarded as $\Theta (1)$ for ease of presentation. Note that in this notation, second-order heterogeneity $\zeta$ always satisfies $\zeta \leq \Theta (L) = \Theta (1)$ . $\sigma_{\mathrm{dif}}^2$ is the squared local gradient norm at an optimum (for the precise definition, see (Khaled et al., 2020)). + +Other Related Work. Several recent papers have also studied local algorithms combined with variance reduction technique (Sharma et al., 2019; Das et al., 2020; Karimireddy et al., 2020a). Sharma et al. (2019) have considered Parallel Restart SPIDER (PR-SPIDER), that is a local variant of SPIDER (Fang et al., 2018) and shown that the proposed algorithm achieves the optimal total computational complexity and the communication complexity of $1 / \varepsilon$ for noncovnex smooth objectives. However, these rates essentially match the ones of non-local SARAH and no advantage of localization has been shown. Also, Das et al. (2020) have considered a SPIDER like local algorithm called FedGLOMO but the derived communication complexity is only $1 / \varepsilon^{3 / 2}$ in general and the rate is even worse than minibatch SARAH. Karimireddy et al. (2020a) have proposed MIME, which is essentially a combination of local SGD and SVRG-like variance reduction technique. They have shown that MIME achieves the communication complexity of $1 / (\mathcal{B}\varepsilon) + 1 / (P^{3 / 4}\varepsilon^{3 / 2}) + \zeta /\varepsilon$ for $\zeta$ second-order heterogeneous nonconvex smooth objectives. Importantly, the second term of the rate of BVR-L-SGD has better dependencies on $P$ and $\mathcal{B}$ than the one of MIME. Particularly, BVR-L-SGD achieves $\zeta /\varepsilon$ when $\mathcal{B}\to \infty$ but MIME does not possess this property. + +# 2. Problem Definition and Assumptions + +In this section, we first introduce the notations used in this paper. Then, the problem setting considered in this paper is + +illustrated and theoretical assumptions are given. + +Notation. $\| \cdot \|$ denotes the Euclidean $L_{2}$ norm $\| \cdot \| _2\colon \| x\| =$ $\sqrt{\sum_{i}x_{i}^{2}}$ for vector $x$ . For a matrix $X$ , $\| X\|$ denotes the induced norm by the Euclidean $L_{2}$ norm. For a natural number $m$ , $[m]$ denotes the set $\{1,2,\dots,m\}$ . For a set $A$ , $\# A$ means the number of elements, which is possibly $\infty$ . For any number $a,b$ , $a\vee b$ and $a\wedge b$ denote $\max \{a,b\}$ and $\min \{a,b\}$ respectively. We denote the uniform distribution over $A$ by $\operatorname {Unif}(A)$ . + +# 2.1. Problem Setting + +We want to minimize nonconvex smooth objective + +$$ +f (x) := \frac {1}{P} \sum_ {p = 1} ^ {P} f _ {p} (x), \text {w h e r e} f _ {p} (x) := \mathbb {E} _ {z \sim D _ {p}} [ \ell (x, z) ] +$$ + +for $x \in \mathbb{R}^d$ , where $D_p$ is the data distribution associated with worker $p$ . Although we consider both offline (i.e., $\# \mathrm{supp}(D_p) < \infty$ for every $p \in [P]$ ) and online (i.e., $\# \mathrm{supp}(D_p) = \infty$ for some $p \in [P]$ ) settings, it is assumed for offline settings that each local dataset has an equal number of samples, i.e., $\# \mathrm{supp}(D_p) = \# \mathrm{supp}(D_{p'})$ for every $p, p' \in [P]$ just for simplicity. We assume that each worker $p$ can only access the own data distribution $D_p$ without communication. Aggregation (e.g., summation) of all the worker's $d$ -dimensional parameters or broadcast of a $d$ -dimensional parameter from one worker to the other workers can be realized by single communication. In typical + +situations, single communication is more time-consuming than single stochastic gradient computation. Let $\mathcal{C}$ denotes the single communication cost and $\mathcal{G}$ does the single stochastic gradient computation. Using these notations, we assume $\mathcal{C} \geq \mathcal{G}$ . Since we expect that a larger number of available stochastic gradients in a communication round leads to faster optimization, we can increase the number of stochastic gradient computations unless the total gradient computational time exceeds $\mathcal{C}$ . This motivates the concept of local computation budget $\mathcal{B} (\leq \mathcal{C} / \mathcal{G})$ : given a communication and computational environment, it is assumed that each worker can only compute at most $\mathcal{B}$ single stochastic gradients per communication round on average. Then, we compare the communication complexity, that is the total number of communication rounds of a distributed optimization algorithm to achieve the desired optimization accuracy. From the definition, given a communication and computational environment, the communication complexity with a fixed local computation budget $\mathcal{B} := \mathcal{C} / \mathcal{G}$ captures the best achievable total execution time of an algorithm. Generally, for a larger budget, we expect smaller communication complexity. + +# 2.2. Theoretical Assumptions + +In this paper, we always assume the following four assumptions. Assumptions 2, 3 and 4 are fairly standard in first-order nonconvex optimization. + +Assumption 1 (Heterogeneity). $\{f_p\}_{p = 1}^P$ is second-order $\zeta$ -heterogeneous, i.e., for any $p,p^{\prime}\in [P]$ + +$$ +\left| \left| \nabla^ {2} f _ {p} (x) - \nabla^ {2} f _ {p ^ {\prime}} (x) \right| \right| \leq \zeta , \forall x \in \mathbb {R} ^ {d}. +$$ + +Assumption 1 characterizes the heterogeneity of local objectives $\{f_p\}_{p = 1}^P$ and has a critical role in our analysis. We expect that relatively small heterogeneity to the smoothness reduces the necessary number of communication to optimize global objective $f = (1 / P)\sum_{p = 1}^{P}f_{p}$ . If the local objectives are identical, i.e., $D_{p} = D_{p^{\prime}}$ for every $p,p^{\prime}\in [P]$ , $\zeta$ becomes zero. When each $D_{p}$ is the empirical distribution of $n / P$ IID samples from common data distribution $D$ , we have $\| \nabla^2 f_p(x) - \nabla^2 f_{p'}(x)\| \leq \widetilde{\Theta} (\sqrt{P / n} L)$ with high probability by matrix Hoeffding's inequality under Assumption 2 for fixed $x^5$ . Hence, in classical distributed learning regimes, Assumption 1 naturally holds. An important remark is that Assumption 2 implies $\zeta \leq 2L$ , i.e., the heterogeneity is bounded by the smoothness. This means that Assumption 1 gives an interpolation between the identical data setting $\zeta = 0$ and the extremely non-IID setting $\zeta = 2L$ . Even in federated learning regimes $\zeta \gg \sqrt{P / n} L$ , we can expect $\zeta \ll 2L$ for some problems. + +# Algorithm 1 Local $\mathrm{GD}(\tilde{x}_0,\eta ,B,b,K,T)$ + +1: for $t = 1$ to $T$ do + +2: for $p = 1$ to $P$ in parallel do + +3: Set $x_0^{(p)} = \widetilde{x}_{t - 1}$ + +4: for $k = 1$ to $K$ do + +5: Update $x_{k}^{(p)} = x_{k - 1}^{(p)} - \eta \nabla f_{p}(x_{k - 1}^{(p)})$ + +6: end for + +7: end for + +8: Communicate $\{x_{t}^{(p)}\}_{p = 1}^{P}$ . + +9: $\widetilde{x}_t = \frac{1}{P}\sum_{p = 1}^P x_{\hat{k}}^{(p)}$ ( $\hat{k} \sim \mathrm{Unif}[K]$ ). + +10: end for + +11: Return: $\tilde{x}_{\hat{t}}$ ( $\hat{t} \sim \mathrm{Unif}[T]$ ). + +Assumption 2 (Smoothness). For any $p \in [P]$ and $z \in \operatorname{supp}(D_p)$ , $\ell(\cdot, z)$ is $L$ -smooth, i.e., + +$$ +\| \nabla \ell (x, z) - \nabla \ell (y, z) \| \leq L \| x - y \|, \forall x, y \in \mathbb {R} ^ {d}. +$$ + +We assume $L$ -smoothness of loss $\ell$ rather than risk $f$ . This assumption is a bit strong, but is typically necessary in the analysis of variance reduced gradient estimators. + +Assumption 3 (Existence of global optimum). $f$ has a global minimizer $x_{*}\in \mathbb{R}^{d}$ + +Assumption 4 (Bounded gradient variance). For every $p \in [P]$ , + +$$ +\mathbb {E} _ {z \sim D _ {p}} \| \nabla \ell (x, z) - \nabla f _ {p} (x) \| ^ {2} \leq \sigma^ {2}. +$$ + +Assumption 4 says that the variance of stochastic gradient is bounded for every local objective. + +# 3. Approach and Proposed Algorithms + +In this section, we introduce our approach and provide details of the proposed algorithms. + +# 3.1. Core Concepts and Approach + +Here, we describe four main building blocks of our algorithm, that are localization, bias reduction, stochasticization and variance reduction. Although our algorithm relies on SARAH like variance reduction technique, in this subsection we will describe our approach using SVRG like variance reduction rather than SARAH like one to simply convey the core ideas. + +Localization. One of the promising methods for reducing communication cost is local methods. In local methods, each worker independently optimizes the local objective and periodically communicate the current solution. For example, the algorithm of local GD, which is a deterministic variant of local SGD, is given in Algorithm 1. In some sense, the local gradient $\nabla f_{p}(x)$ can be regarded as a biased + +estimator of the global gradient $\nabla f(x)$ . One of the limitations of local GD is the existence of the potential bias of the local gradient $\nabla f_{p}(x)$ to approximate the global one $\nabla f(x)$ for heterogeneous local objectives $\{f_p\}_{p = 1}^P$ . The bias $\| \nabla f_p(x) - \nabla f(x)\|$ critically affects the convergence speed and can be bounded as $\| \nabla f_p(x) - \nabla f(x)\| \leq \zeta_1$ under the first order $\zeta_{1}$ -heterogeneity condition. This implies that the bias heavily depends on the heterogeneity parameter $\zeta_{1}$ and does not converge to zero as $x\to x_{*}$ . Hence, the existing analysis of local methods requires extremely small $\zeta_{1}$ that typically depends on the optimization accuracy $\varepsilon$ to surpass non-local methods including GD and minibatch SGD in terms of communication complexity, which is quite limited in many situations. + +Bias Reduction. To reduce the bias of local gradient, we introduce bias reduction technique. Concretely, we construct the local estimator $\nabla f_{p}(x) - \nabla f_{p}(x_{0}) + \nabla f(x_{0})$ to approximate $\nabla f(x)$ . Here, $x_0$ is the previously communicated solution. This construction evokes the famous variance reduction technique. Analogically to the analysis of variance reduced gradient estimators, under the second order $\zeta$ -heterogeneity, the bias can be bounded as $\| \nabla f_p(x) - \nabla f_p(x_0) + \nabla f(x_0) - \nabla f(x)\| \leq \zeta \| x - x_0\|$ . This means that the bias converges to zero as $x$ and $x_0\to x_*$ . Hence, the bias of the introduced estimator is reduced by utilizing the periodically computed global gradient $\nabla f(x)$ . This enables us to show faster convergence than vanilla non-local and local GD even for not too small $\zeta$ . + +Stochastization. Generally, deterministic methods require huge computational cost for single update in large scale optimization. The classical idea to handle this problem is stochasticization. For example, non-distributed SGD naively uses $\nabla \ell (x,z)$ with single sample $z\sim D_p$ to approximate $\nabla f(x) = \mathbb{E}_{z\sim D}[\nabla \ell (x,z)]$ . Although stochasticization reduces the computational cost per update, the variance due to it generally slows down the convergence speed. Similar to standard SGD, we can naively stochastize our bias reduced estimator as $\ell (x,z) - \ell (x_0,z) + (1 / P)\sum_{p' = 1}^{P}\ell (x_0,z_{p'})$ where $z\sim D_p$ and $z_{p'}\sim D_{p'}$ for $p'\sim [P]$ . Here, $\{z_{p'}\}_{p' = 1}^P$ is sampled only at communication time. As pointed out before, the variance $\mathbb{E}_{z,z'\sim D_p}\| \ell (x,z) - \ell (x_0,z) + (1 / P)\sum_{p' = 1}^{P}\ell (x_0,z_{p'}) - (\nabla f_p(x) - \nabla f_p(x_0) + \nabla f(x_0))\|^2$ caused by stochasticization may leads to slow convergence. + +Variance Reduction. To reduce the variance of the gradient estimator due to stochasticization, we introduce variance reduction technique. Variance reduction is also classical technique and has been extensively analysed both in convex and nonconvex optimization. The essence of variance reduction is the utilization of periodically computed full gradient $\nabla f(x)$ . In non-distributed cases, a variance reduced estimator is defined as $\nabla \ell (x,z) - \nabla \ell (x_0,z) + \nabla f(x_0)$ with $z\sim D$ . This estimator is unbiased and the vari- + +Algorithm 2 BVR-L-SGD $(\widetilde{x}_0,\eta ,b,\widetilde{b},K,T,S)$ +1: for $s = 1$ to $S$ do +2: for $p = 1$ to $P$ in parallel do +3: if $\widetilde{b} \geq \frac{1}{P}\sum_{p=1}^{P}\# \mathrm{supp}(D_p)$ then +4: $\widetilde{\nabla}^{(p)} = \nabla f_p(\widetilde{x}_{s-1})$ . +5: else +6: $\widetilde{\nabla}^{(p)} = \frac{1}{b}\sum_{l=1}^{\widetilde{b}}\nabla \ell(\widetilde{x}_{s-1},z_l)(z_l \stackrel{i.i.d.}{\sim} D_p)$ . +7: end if +8: end for +9: Communicate $\{\widetilde{\nabla}^{(p)}\}_{p=1}^{P}$ , set $\widetilde{v}_0 = \frac{1}{P}\sum_{p=1}^{P}\widetilde{\nabla}^{(p)}$ . +10: Set $x_0 = x_{-1} = \widetilde{x}_{s-1}$ . +11: for $t = 1$ to $T$ do +12: for $p = 1$ to $P$ in parallel do +13: $g_t^{(p)}(x_{t-1}) = \frac{1}{Kb}\sum_{l=1}^{Kb}\nabla \ell(x_{t-1},z_l)$ , +14: $g_t^{(p)}(x_{t-2}) = \frac{1}{Kb}\sum_{l=1}^{Kb}\nabla \ell(x_{t-2},z_l)$ +15: for $z_l \stackrel{i.i.d.}{\sim} D_p$ . +16: $\widetilde{v}_t^{(p)} = g_t^{(p)}(x_{t-1}) - g_t^{(p)}(x_{t-2}) + \widetilde{v}_{t-1}^{(p)}$ . +17: end for +18: Communicate $\{\widetilde{v}_t^{(p)}\}_{p=1}^P$ , set $\widetilde{v}_t = \frac{1}{P}\sum_{p=1}^{P}\widetilde{v}_t^{(p)}$ . +19: for $p = 1$ to $P$ in parallel do +20: $x_t^{(p)}, x_t^{(p),\mathrm{out}} = \text{Local-Routine}(p,x_{t-1},\eta,\widetilde{v}_t,b,K)$ . +21: end for +22: Communicate $\{x_t^{(p)}\}_{p=1}^P$ and $\{x_t^{(p),\mathrm{out}}\}_{p=1}^P$ . +23: Set $x_t = x_t^{(\hat{p})}$ and $x_t^{\mathrm{out}} = x_t^{(\hat{p}),\mathrm{out}}$ ( $\hat{p} \sim \mathrm{Unif}[P]$ ). +24: end for +25: Set $\widetilde{x}_s = x_T$ and $\widetilde{x}_s^{\mathrm{out}} = x_t^{\mathrm{out}}$ ( $\hat{t} \sim \mathrm{Unif}[T]$ ). +26: Set $\widetilde{x}_s = x_T$ and $\widetilde{x}_s^{\mathrm{out}} = x_t^{\mathrm{out}}$ ( $\hat{t} \sim \mathrm{Unif}[S]$ ). +27: end for +28: Return: $\widetilde{x}^{\mathrm{out}} = \widetilde{x}_s^{\mathrm{out}}$ ( $\hat{s} \sim \mathrm{Unif}[S]$ ). + +once $\mathbb{E}_{z\sim D}\| \nabla \ell (x,z) - \nabla \ell (x_0,z) + \nabla f(x_0) - \nabla f(x)\| ^2$ can be bounded by $L^2\| x - x_0\|^2$ , where $L$ is the smoothness parameter of $\ell$ . If $x$ and $x_0\to x_*$ , the variance converges to zero. In this mean, the estimator reduces the variance caused by stochasticization and also maintains computational efficiency by using periodically computed global full gradients. Analogous to this formulation, each worker $p$ computes a variance reduced local gradient estimator $\nabla \ell (x,z) - \nabla \ell (x_0,z) + \nabla f(x_0)$ with $z\sim D_p$ . + +# Concrete Algorithm + +In this paragraph, we illustrate the concrete procedure of our proposed algorithm based on the concepts described in the previous paragraph. + +The proposed algorithm for nonconvex objectives is provided in Algorithm 2. In line 2-9, worker $p$ computes the full gradient of local objective $f_{p}$ (or a large batch stochastic gradient of $f_{p}$ if the learning problem is on-line, which means that $\# \mathrm{supp}(D_p) = \infty$ for some $p$ ). Then, each + +Algorithm 3 Local-Routine $(p, x_0, \eta, v_0, b, K)$ + +1: Set $x_0^{(p)} = x_{-1}^{(p)} = x_0$ . +2: for $k = 1$ to $K$ do +3: $g_{k}^{(p)}(x_{k - 1}^{(p)}) = \frac{1}{b}\sum_{l = 1}^{b}\ell (x_{k - 1}^{(p)},z_{l}),g_{k}^{(p)}(x_{k - 2}^{(p)}) =$ + +$$ +\frac {1}{b} \sum_ {l = 1} ^ {b} \ell (x _ {k - 2} ^ {(p)}, z _ {l}) \left(z _ {l} \begin{array}{c c} i. i. d. \\ \sim \end{array} D _ {p}\right). +$$ + +4: $v_{k}^{(p)} = g_{k}^{(p)}(x_{k - 1}^{(p)}) - g_{k}^{(p)}(x_{k - 2}^{(p)}) + v_{k - 1}^{(p)}.$ +5: Update $x_{k}^{(p)} = x_{k - 1}^{(p)} - \eta v_{k}^{(p)}$ +6: end for +7: Return: $x_{K}^{(p)}$ , $x_{\hat{k}}^{(p)}$ ( $\hat{k} \sim \mathrm{Unif}[K]$ ). + +worker broadcasts it and the gradient of global objective $f$ is executed by averaging the communicated local gradients (line 9). Then, for each iteration $t$ , each worker computes variance reduced local gradient $\widetilde{v}_t^{(p)}$ that approximates the full local gradient using Kb IID samples (line 13-16), that is an important process for computational efficiency. Then, $\{\widetilde{v}_t^{(p)}\}_{p=1}^P$ is communicated and $\widetilde{v}_t$ is obtained by averaging them. Using previous solution $x_{t-1}$ and $\widetilde{v}_t$ as inputs, each worker runs Local-Routine (Algorithm 3) (line 21). The next solution $x_t$ at iteration $t$ is set to the randomly chosen solutions from Local-Routine's outputs $\{x_t\}_{p=1}^P$ rather than averaging them. When we terminate the loop from line 11 to 22, the next solution at stage $s$ is set to the randomly chosen solutions from $\{x_t\}_{p=1,t=1}^P$ (line 24) rather than averaging them again. Although the model averaging process has a critical role in all the previous local algorithms, the random picking process is essential in our analysis to fully utilize the second-order heterogeneity and is one of the algorithmic novelties of our method. + +The local computation algorithm Local-Routine is illustrated in Algorithm 3. In lines 3-5, we again use variance reduction with $v_{0}$ as a snapshot gradient. Here, we adopt the SARAH like variance reduction rather than the SVRG like one because SARAH achieves the optimal computational complexity for non-distributed nonconvex optimization. + +Remark (Communication and computational complexity). The communication complexity is $\Theta(ST)$ and the averaged number of single gradient computations per communication round for each worker is $\Theta((Kb + \widetilde{b}/T))$ . + +Remark (Generalization of SARAH). When $K = 1$ , BVR-L-SGD exactly matches to minibatch SARAH. In this sense, BVR-L-SGD is a generalization of minibatch SARAH. + +Remark (Practical Implementation). Practically, in line 19-24 of Algorithm 2, we randomly choose worker $\hat{p}$ at first and execute Local-Routine only for worker $\hat{p}$ . Note that this procedure gives an equivalent algorithm to the original one but reduces the computational and communication cost. More specific procedures of the practical implementation are found in the supplementary material (Section C). + +# 4. Convergence Analysis + +In this section, we provide theoretical convergence analysis of our proposed algorithm. For the proofs, see the supplementary material (Section A and B). + +# 4.1. Analysis of Local-Routine + +Here, we analyse Local-Routine (Algorithm 3). + +Lemma 4.1 (Descent Lemma). Suppose that Assumption 2 holds. There exists $\eta_1 = \Theta(1/L)$ such that for any $\eta \leq \eta_1$ , Local-Routine $(p, x_0, \eta, v_0, b, K)$ satisfies for $k \in [K]$ , + +$$ +\begin{array}{l} \mathbb {E} \| \nabla f (x _ {k - 1} ^ {(p)}) \| ^ {2} \leq \Theta \left(\frac {1}{\eta}\right) (\mathbb {E} f (x _ {k - 1} ^ {(p)}) - \mathbb {E} f (x _ {k} ^ {(p)})) \\ + \frac {5}{2} \mathbb {E} \| v _ {k} ^ {(p)} - \nabla f (x _ {k - 1} ^ {(p)}) \| ^ {2}. \\ \end{array} +$$ + +The deviation of $v_{k}^{(p)}$ from $\nabla f(x_{k - 1}^{(p)})$ can be bounded by the following lemma. + +Lemma 4.2. Suppose that Assumptions 1 and 2 hold. Then, there exists $\eta_{2} = \Theta (1 / (K\zeta)\wedge \sqrt{b} /(\sqrt{K} L))$ such that for $\eta \leq \eta_{2}$ , Local-Routine $(p,x_0,\eta ,v_0,b,K)$ satisfies + +$$ +\begin{array}{l} \frac {1}{K} \sum_ {k = 1} ^ {K} \mathbb {E} \| v _ {k} ^ {(p)} - \nabla f (x _ {k - 1} ^ {(p)}) \| ^ {2} \\ \leq \Theta \left(C _ {\eta}\right) \sum_ {k = 1} ^ {K} \mathbb {E} \left\| \nabla f (x _ {k - 1} ^ {(p)}) \right\| ^ {2} + \Theta (1) \| v _ {0} - \nabla f (x _ {0}) \| ^ {2}, \\ \end{array} +$$ + +where $C_{\eta}\coloneqq \eta^{2}L^{2} / b + \eta^{2}\zeta^{2}K$ + +Combining Lemma 4.1 and 4.2 results in the following proposition. + +Proposition 4.3. Suppose that Assumptions 1 and 2 hold. There exists $\eta_3 = \Theta(1 / L \wedge 1 / (K\zeta) \wedge \sqrt{b} / (\sqrt{K}L))$ such that for $\eta \leq \eta_3$ , Local-Routine $(p, x_0, \eta, v_0, b, K)$ satisfies + +$$ +\begin{array}{l} \mathbb {E} \| \nabla f (x _ {\hat {k}} ^ {(p)}) \| ^ {2} \leq \Theta \left(\frac {1}{\eta K}\right) (\mathbb {E} f (x _ {0}) - \mathbb {E} f (x _ {K} ^ {(p)})) \\ + \Theta (1) \| v _ {0} - \nabla f (x _ {0}) \| ^ {2}. \\ \end{array} +$$ + +# 4.2. Analysis of BVR-L-SGD + +Here, we analyse BVR-L-SGD (Algorithm 2). The following lemma bounds the variance of $\widetilde{v}_t$ , which arises in Proposition 4.3. + +Lemma 4.4. Suppose that Assumptions 1, 2 and 4 hold. Then, there exists \(\eta_4 = \Theta(1/(K\zeta) \wedge \sqrt{b}/(\sqrt{K}L) \wedge \sqrt{Pb}/(\sqrt{KT}L))\) such that for \(\eta \leq \eta_4\), \(BVR-L-SGD(\widetilde{x}_0, + +$\eta, b, \widetilde{b}, K, T, S)$ satisfies + +$$ +\begin{array}{l} \frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} \| \widetilde {v} _ {t} - \nabla f (x _ {t - 1}) \| ^ {2} \\ \leq \Theta \left(C _ {\eta} ^ {\prime}\right) \frac {1}{T} \sum_ {t ^ {\prime} = 1} ^ {T} \frac {1}{P} \sum_ {p = 1} ^ {P} \mathbb {E} [ G _ {t ^ {\prime}} ^ {(p)} ] + \mathbb {1} _ {\widetilde {b} < \frac {n}{P}} \frac {\sigma^ {2}}{P \widetilde {b}}. \\ \end{array} +$$ + +where $C_{\eta}^{\prime} \coloneqq \eta^{2}L^{2}KT / (Pb) + \eta^{2}L^{2}K / b + \eta^{2}\zeta^{2}K^{2}$ , $n \coloneqq \sum_{p = 1}^{P}\# \mathrm{supp}(D_p)$ and $G_{t'}^{(p)} \coloneqq \| \nabla f(x_{t' - 1}^{(p),\mathrm{out}})\| ^2$ . + +Using the result of Local-Routine (Proposition 4.3) and Lemma 4.4, we obtain the following theorem. + +Theorem 4.5. Suppose that Assumptions 1, 2, 3 and 4 hold. Then, there exists $\eta = \Theta(1 / L \wedge 1 / (K\zeta) \wedge \sqrt{b} / (\sqrt{K}L) \wedge \sqrt{Pb} / (\sqrt{KT}L))$ such that BVR-L-SGD( $\widetilde{x}_0$ , $\eta$ , $b$ , $\widetilde{b}$ , $K$ , $T$ , $S$ ) satisfies + +$$ +\begin{array}{l} \mathbb {E} \| \nabla f (\widetilde {x} ^ {\text {o u t}}) \| ^ {2} \leq \Theta \left(\frac {1}{\eta K T S}\right) \left(\mathbb {E} f (\widetilde {x} _ {0}) - f (x _ {*})\right) \\ + \Theta (1) \mathbb {1} _ {\widetilde {b} < \frac {n}{P}} \frac {\sigma^ {2}}{P \widetilde {b}}, \\ \end{array} +$$ + +where $n\coloneqq \sum_{p = 1}^{P}\# \mathrm{supp}(D_p)$ + +Theorem 4.5 immediately implies the following corollary which characterises the communication complexity of BVR-L-SGD. + +Corollary 4.6. Suppose that Assumptions 1, 2, 3 and 4 hold. We denote $n = \sum_{p=1}^{P} \# \operatorname{supp}(D_p)$ . Let $\widetilde{b} = \Theta((n/P) \wedge (\sigma^2/(P\varepsilon)))$ . Then, there exists $\eta = \Theta(1/L \wedge 1/(K\zeta) \wedge \sqrt{b}/(\sqrt{KL}) \wedge \sqrt{Pb}/(\sqrt{KT}L))$ such that BVR-L-SGD( $\widetilde{x}_0, \eta, b, \widetilde{b}, K, T, S$ ) with $S = \Theta(1+1/(\eta KT\varepsilon))$ satisfies $\mathbb{E}\|\nabla f(\widetilde{x}^{\mathrm{out}})\|^2 \leq \Theta(\varepsilon)$ with communication complexity + +$$ +S T = \Theta \left(\frac {L}{K \varepsilon} + \frac {\zeta}{\varepsilon} + \frac {L}{\sqrt {K b} \varepsilon} + \sqrt {\frac {T}{K b P}} \frac {L}{\varepsilon} + T\right). +$$ + +Remark (Communication efficiency). Given local computation budget $\mathcal{B}$ , we set $T = \Theta(1 + \widetilde{b} / \mathcal{B})$ and $Kb = \Theta(\mathcal{B})$ with $b \leq \Theta(\sqrt{\mathcal{B}})$ , where $\widetilde{b}$ was defined in Corollary 4.6. Then, we have the averaged number of local computations per communication round $Kb + \widetilde{b} / T = \Theta(\mathcal{B})$ and the total communication complexity with budget $\mathcal{B}$ becomes $\Theta((L / (\sqrt{\mathcal{B}}\varepsilon) + \sqrt{n \wedge (\sigma^2 / \varepsilon)L / (\mathcal{BP}\varepsilon) + (n \wedge (\sigma^2 / \varepsilon)) / (\mathcal{BP}) + \zeta / \varepsilon)}$ . + +# 5. Numerical Results + +In this section, we provide several experimental results to verify our theoretical findings. + +We conducted a ten-class classification on CIFAR10 $^{6}$ dataset. Several heterogeneity patterns of local datasets + +![](images/cdd42d6ae5392bc6daeac54cd60395a64d8fc2358277bef0ff026ebf16968de5.jpg) +Figure 1. An illustration of our local datasets generation process. + +were artificially created. For each heterogeneity, we compared the empirical performances of our method and several existing methods. + +Data Preparation. We first equalized the number of data per class by randomly removing the excess data for both the train and test datasets for only simplicity. Then, for fixed $q \in \{0.1, 0.35, 0.6, 0.85\}$ , $q \times 100\%$ of the data of class $p$ was assigned to worker $p$ for $p \in [P]$ . Here, we set the number of workers to the number of classes. Then, for each class $p$ , we equally divided the remained $(1 - q) \times 100\%$ data of class $p$ into $P - 1$ sets and distributed them to correspondence worker $p' \neq p$ . As a result, we obtained several patterns of class imbalanced local datasets with various heterogeneity (we expect smaller heterogeneity for smaller $q$ and particularly $\zeta \approx 0$ when $q = 0.1$ since $P = 10$ ). An illustration of this process for $P = 3$ is given in Figure 1. From this process, we fixed the number of workers $P$ to ten. Finally, we normalized each channel of the data to be mean and standard deviation 0.5. + +Models. We conducted our experiments using an one-hidden layer fully connected neural network with 100 hidden units and softmax activation. For loss function, we used the standard cross-entropy loss. We initialized parameters by uniformly sampling the parameters from $\left[-\sqrt{6 / (n_{\mathrm{in}} + n_{\mathrm{out}})},\sqrt{6 / (n_{\mathrm{in}} + n_{\mathrm{out}})}\right]$ (Glorot & Bengio, 2010), where $n_{\mathrm{in}}$ and $n_{\mathrm{out}}$ are the number of units in the input and output layers respectively. Furthermore, we add $L_{2}$ -regularizer to the empirical risk with fixed regularization parameter $5\times 10^{-3}$ . + +Implemented Algorithms. We implemented minibatch SGD, Local SGD, SARAH, SCAFFOLD and our BVR-L-SGD. For each local computation budget $\mathcal{B} \in \{256, 512, 1024\}$ , we set $K = \mathcal{B} / 16$ and $b = 16$ for local methods (Local SGD, SCAFFOLD and BVR-L-SGD), and $b = \mathcal{B}$ for non-local ones (minibatch SGD and SARAH). Note that each algorithm requires the same order of stochastic gradient computations per communication. For each algorithm, we tuned learning rate $\eta$ from $\{0.005, 0.01, 0.05, 0.1, 0.5, 1.0\}$ . The details of the tuning procedure are found in the supplementary material (Section D). + +Evaluation. We compared the implemented algorithms using four criteria of train loss; train accuracy; test loss and test + +![](images/cec26e871a58866bdb51d4bca85fca81258e4920e5d95bd8cacac1c5b4494110.jpg) +(a) Best Train Loss + +![](images/2515617b9b245d4403309cb7e4a4dac68a0fd16ba0edb8cc5182a2b21fc0d243.jpg) +(b) Best Test Accuracy +Figure 2. Comparison of the best train loss and test accuracy against heterogeneity parameter $q$ . + +![](images/7f5959461f7a1cbe1a3238ae9d78d237c13e555b0ac0dc4ab5f8a2355f2b22db.jpg) +(a) Best Train Loss +Figure 3. Comparison of the best train loss and test accuracy against local computation budget $\mathcal{B}$ . + +![](images/01fabbc7830102fa51bb3320d752a5d68a6ed6554b15d9f2a5dedde4148dd4d2.jpg) +(b) Best Test Accuracy + +accuracy against (i) heterogeneity $q$ ; (ii) local computation budgets $\mathcal{B}$ and (iii) the number of communication rounds. The total number of communication rounds was fixed to 3,000 for each algorithm. We independently repeated the experiments 5 times and report the mean and standard deviation of the above criteria. Due to the space limitation, we will only report train loss and test accuracy in the main paper. The full results are found in the supplementary material (Section D). + +Results 1: Effect of the heterogeneity. Here, we investigate the effect of the heterogeneity on the convergence speed of the algorithms. To clarify the pure effect of the heterogeneity, we fixed the local computation budget $\mathcal{B}$ to 1,024, which was the largest one in our experiments. Figure 2 shows the comparison of the best-achieved train loss and test accuracy in 3,000 communication rounds against heterogeneity parameter $q$ . From this, we can see that the convergence speed of the local methods deteriorated as heterogeneity parameter $q$ increased. Particularly, the degree of the performance degradation of L-SGD and SCAFFOLD was serious. In contrast, this phenomenon was not observed for non-local methods, because the convergence rates of non-local methods do not depend on heterogeneity $\zeta$ as in Table 1. Importantly, even for the largest $q$ , BVR-L-SGD significantly outperformed the other methods. + +Results 2: Effect of the local computation budget size. Now, we examine the effect of the size of the local computation budget $\mathcal{B}$ to the convergence speed. For this purpose, we fixed heterogeneity parameter $q$ to the smallest one. Figure 3 shows the comparison of the best-achieved train loss and test accuracy against local computation budget $\mathcal{B}$ . We can see that the local methods improved their performances as local computation budget $\mathcal{B}$ increased, but non-local methods did not. This is because local methods can potentially achieve a smaller communication complexity than $1 / \varepsilon$ by increasing $\mathcal{B}$ for small $\zeta$ , but non-local methods can not break the barrier of $1 / \varepsilon$ for any $\mathcal{B}$ as in Table 1. + +Results 3: Effect of the number of communication rounds. Finally, to see the trends of train loss and test accuracy during optimization, we give the comparison of + +the train loss and test accuracy against the number of communication rounds (Figure 4). For the space limitation, we only report the case $\mathcal{B} = 1,024$ . From these results, it can be seen that our proposed BVR-L-SGD consistently outperformed the other methods from beginning to end. + +In summary, for small heterogeneity, local methods significantly surpassed non-local methods. For relatively large heterogeneity, the performances of the existing local methods were seriously degraded. In contrast, the degree of deterioration of BVR-L-SGD was small and BVR-L-SGD consistently out-performed both the existing non-local and local methods. These observations strongly verify the theoretical findings and showed the empirical superiority of our method. + +# 6. Conclusion and Future Work + +In this paper, we studied our proposed BVR-L-SGD for nonconvex distributed learning, which is based on the bias-variance reduced gradient estimator to fully utilize the small second-order heterogeneity of local objectives and suggests randomly picking up one of the local models instead of taking the average of them when workers are synchronized. Our theory implies the superiority of BVR-L-SGD to previous non-local and local methods in terms of communication complexity. The numerical results strongly encouraged our theoretical results and suggested the empirical superiority of the proposed method. + +One promising and challenging future work is to extend our algorithm and theory to the problem of finding second-order stationary points. Although there are many papers for finding second-order stationary points for general nonconvex problems (Ge et al., 2015; Allen-Zhu, 2017; Jin et al., 2017; Li, 2019), it might be inherently difficult for local algorithms to efficiently find a local minima due to the nature of local updates. An open question is that: can we construct a local algorithm that guarantees to find second-order stationary points and is more communication efficient than non-local methods for local objectives with small heterogeneity? + +![](images/2a24a33046c4d217249c44cb99ea8bba6c4af679d8c0467c751f4e9f3341d5fb.jpg) +(a) Train Loss + +![](images/49ff931405677cdcfbeabb25758fa4aa86f9047f033b2488c5f2447621980664.jpg) +(b) Test Accuracy + +![](images/9cd7f4fbbbcab47bc73674ea06cdbb199cacd5c783b7da758b42f9e9f1cc5777.jpg) +(c) Train Loss + +![](images/893b2d974c2868ea9510f1e0202cbfb3faa8f0847f055417f66e3c67557d1138.jpg) +(d) Test Accuracy + +![](images/4f4ea408e9dfc8b339d556a8628cb56c8a3ab646be65ca54b1b71e1a1e0b8210.jpg) +(e) Train Loss + +![](images/a8f3770d53f89fe38298a02b33807d4a45450ddcffa2ff34c8d52b98e37cd548.jpg) +(f) Test Accuracy + +![](images/14bffc73d456e135460f2b9e9c083e52561ea6f33c81f7c9ed2ef9e25dba2835.jpg) +(g) Train Loss + +![](images/f9ab137e9ebdb5ac056ca9ed2c00a4ae16f59680ca5e1ecd42fc263f4bb0b50a.jpg) +(h) Test Accuracy +Figure 4. Comparison of the train loss and test accuracy against the number of communication rounds. + +# Acknowledgement + +TS was partially supported by JSPS KAKENHI (18K19793, 18H03201, and 20H00576), Japan DigitalDesign, and JST CREST. + +# References + +Allen-Zhu, Z. Natasha 2: Faster non-convex optimization than sgd. arXiv preprint arXiv:1708.08694, 2017. +Allen-Zhu, Z. and Hazan, E. Variance reduction for faster non-convex optimization. In International conference on machine learning, pp. 699–707. PMLR, 2016. +Das, R., Acharya, A., Hashemi, A., Sanghavi, S., Dhillon, + +I. S., and Topcu, U. Faster non-convex federated learning via global and local momentum. arXiv preprint arXiv:2012.04061, 2020. +Dekel, O., Gilad-Bachrach, R., Shamir, O., and Xiao, L. Optimal distributed online prediction using mini-batches. Journal of Machine Learning Research, 13(1), 2012. +Fang, C., Li, C. J., Lin, Z., and Zhang, T. Spider: Near-optimal non-convex optimization via stochastic path integrated differential estimator. arXiv preprint arXiv:1807.01695, 2018. +Ge, R., Huang, F., Jin, C., and Yuan, Y. Escaping from saddle points—online stochastic gradient for tensor decomposition. In Conference on learning theory, pp. 797-842. PMLR, 2015. +Glorot, X. and Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249-256. JMLR Workshop and Conference Proceedings, 2010. +Goyal, P., Dollar, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. +Haddadpour, F. and Mahdavi, M. On the convergence of local descent methods in federated learning. arXiv preprint arXiv:1910.14425, 2019. +Haddadpour, F., Kamani, M. M., Mahdavi, M., and Cadambe, V. R. Local sgd with periodic averaging: Tighter analysis and adaptive synchronization. arXiv preprint arXiv:1910.13598, 2019. +Jin, C., Ge, R., Netrapalli, P., Kakade, S. M., and Jordan, M. I. How to escape saddle points efficiently. In International Conference on Machine Learning, pp. 1724-1732. PMLR, 2017. +Johnson, R. and Zhang, T. Accelerating stochastic gradient descent using predictive variance reduction. Advances in neural information processing systems, 26:315-323, 2013. +Kairouz, P., McMahan, H. B., Avent, B., Bellet, A., Dennis, M., Bhagoji, A. N., Bonawitz, K., Charles, Z., Cormode, G., Cummings, R., et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019. +Karimireddy, S. P., Jaggi, M., Kale, S., Mohri, M., Reddi, S. J., Stich, S. U., and Suresh, A. T. Mime: Mimicking centralized stochastic algorithms in federated learning. arXiv preprint arXiv:2008.03606, 2020a. + +Karimireddy, S. P., Kale, S., Mohri, M., Reddi, S., Stich, S., and Suresh, A. T. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning, pp. 5132-5143. PMLR, 2020b. +Khaled, A., Mishchenko, K., and Richtárik, P. Tighter theory for local sgd on identical and heterogeneous data. In International Conference on Artificial Intelligence and Statistics, pp. 4519-4529. PMLR, 2020. +Koloskova, A., Loizou, N., Boreiri, S., Jaggi, M., and Stich, S. A unified theory of decentralized sgd with changing topology and local updates. In International Conference on Machine Learning, pp. 5381-5393. PMLR, 2020. +Konečny, J., McMahan, B., and Ramage, D. Federated optimization: Distributed optimization beyond the datacenter. arXiv preprint arXiv:1511.03575, 2015. +Lei, L., Ju, C., Chen, J., and Jordan, M. I. Non-convex finite-sum optimization via scsg methods. arXiv preprint arXiv:1706.09156, 2017. +Li, Z. Ssrgd: Simple stochastic recursive gradient descent for escaping saddle points. arXiv preprint arXiv:1904.09265, 2019. +Lin, T., Stich, S. U., Patel, K. K., and Jaggi, M. Don't use large mini-batches, use local sgd. arXiv preprint arXiv:1808.07217, 2018. +McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273-1282. PMLR, 2017. +Nguyen, L. M., Liu, J., Scheinberg, K., and Takáč, M. Sarah: A novel method for machine learning problems using stochastic recursive gradient. In International Conference on Machine Learning, pp. 2613-2621. PMLR, 2017. +Nguyen, L. M., van Dijk, M., Phan, D. T., Nguyen, P. H., Weng, T.-W., and Kalagnanam, J. R. Finite-sum smooth optimization with sarah. arXiv preprint arXiv:1901.07648, 2019. +Reddi, S. J., Hefny, A., Sra, S., Poczos, B., and Smola, A. Stochastic variance reduction for nonconvex optimization. In International conference on machine learning, pp. 314-323. PMLR, 2016a. +Reddi, S. J., Konečny, J., Richtárik, P., Póczós, B., and Smola, A. Aide: Fast and communication efficient distributed optimization. arXiv preprint arXiv:1608.06879, 2016b. + +Sharma, P., Kafle, S., Khanduri, P., Bulusu, S., Rajawat, K., and Varshney, P. K. Parallel restarted spider-communication efficient distributed nonconvex optimization with optimal computation complexity. arXiv preprint arXiv:1912.06036, 2019. +Shokri, R. and Shmatikov, V. Privacy-preserving deep learning. In Proceedings of the 22nd ACM SIGSAC conference on computer and communications security, pp. 1310-1321, 2015. +Stich, S. U. Local sgd converges fast and communicates little. arXiv preprint arXiv:1805.09767, 2018. +Woodworth, B., Patel, K. K., and Srebro, N. Minibatch vs local sgd for heterogeneous distributed learning. arXiv preprint arXiv:2006.04735, 2020a. +Woodworth, B., Patel, K. K., Stich, S., Dai, Z., Bullins, B., McMahan, B., Shamir, O., and Srebro, N. Is local sgd better than minibatch sgd? In International Conference on Machine Learning, pp. 10334-10343. PMLR, 2020b. +Yu, H., Yang, S., and Zhu, S. Parallel restarted sgd with faster convergence and less communication: Demystifying why model averaging works for deep learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 5693-5700, 2019. +Zhou, D., Xu, P., and Gu, Q. Stochastic nested variance reduction for nonconvex optimization. arXiv preprint arXiv:1806.07811, 2018. \ No newline at end of file diff --git a/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/images.zip b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..605bda1c2ff7f5ccaa6ae7198e72b38d0d53533f --- /dev/null +++ b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95fd515f23ffb4cb7393a8177964af0c049c6d99e0de4ccf14ac7137334978b9 +size 355810 diff --git a/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/layout.json b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5def7687b18e4f656be6bc5fb27460b3f1cf65fa --- /dev/null +++ b/biasvariancereducedlocalsgdforlessheterogeneousfederatedlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bbed13a458a44363ced24cb43d2a64a8e12ef51e1c6177bde34f0b048034fde +size 622108 diff --git a/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_content_list.json b/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4f5ed01f2597c8f909bead768eb3e73e38060c2b --- /dev/null +++ b/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d90c0c8354b4988bbf3a9a592a3a395d67324807adc94824dc6ab3c96a9a6b2 +size 93139 diff --git a/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_model.json b/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5c03c199a506750f8c42f34dcb286871d4ade5f4 --- /dev/null +++ b/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5414c4355411f46ab33a49e7228968d81db5f6d8a40e136ec97ccff348ff508b +size 115093 diff --git a/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_origin.pdf b/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..659812be50940029c14c76a16220e6832b200cac --- /dev/null +++ b/bileveloptimizationconvergenceanalysisandenhanceddesign/49a3424c-caa9-42ec-99e8-171051cff063_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93538acc576d7a45080f56b4c7e82f43b4000147dc6eaab364b4b3e57aa25a5f +size 6466858 diff --git a/bileveloptimizationconvergenceanalysisandenhanceddesign/full.md b/bileveloptimizationconvergenceanalysisandenhanceddesign/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9e75efe7de35c84385b4f01375fdf5f8986d3d89 --- /dev/null +++ b/bileveloptimizationconvergenceanalysisandenhanceddesign/full.md @@ -0,0 +1,480 @@ +# Kaiyi Ji1 Junjie Yang1 Yingbin Liang1 + +# Abstract + +Bilevel optimization has arisen as a powerful tool for many machine learning problems such as meta-learning, hyperparameter optimization, and reinforcement learning. In this paper, we investigate the nonconvex-strongly-convex bilevel optimization problem. For deterministic bilevel optimization, we provide a comprehensive convergence rate analysis for two popular algorithms respectively based on approximate implicit differentiation (AID) and iterative differentiation (ITD). For the AID-based method, we orderwisely improve the previous convergence rate analysis due to a more practical parameter selection as well as a warm start strategy, and for the ITD-based method we establish the first theoretical convergence rate. Our analysis also provides a quantitative comparison between ITD and AID based approaches. For stochastic bilevel optimization, we propose a novel algorithm named stocBiO, which features a sample-efficient hypergradient estimator using efficient Jacobian- and Hessian-vector product computations. We provide the convergence rate guarantee for stocBiO, and show that stocBiO outperforms the best known computational complexities orderly with respect to the condition number $\kappa$ and the target accuracy $\epsilon$ . We further validate our theoretical results and demonstrate the efficiency of bilevel optimization algorithms by the experiments on meta-learning and hyperparameter optimization. + +# 1. Introduction + +Bilevel optimization has received significant attention recently and become an influential framework in various machine learning applications including meta-learning (Franceschi et al., 2018; Bertinetto et al., 2018; Rajeswaran et al., 2019; Ji et al., 2020a), hyperparameter + +$^{1}$ Department of Electrical and Computer Engineering, The Ohio State University. Correspondence to: Kaiyi Ji . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +optimization (Franceschi et al., 2018; Shaban et al., 2019; Feurer & Hutter, 2019), reinforcement learning (Konda & Tsitsiklis, 2000; Hong et al., 2020), and signal processing (Kunapuli et al., 2008; Flamary et al., 2014). A general bilevel optimization takes the following formulation. + +$$ +\min _ {x \in \mathbb {R} ^ {p}} \Phi (x) := f (x, y ^ {*} (x)) +$$ + +$$ +\text {s . t .} \quad y ^ {*} (x) = \underset {y \in \mathbb {R} ^ {q}} {\arg \min } g (x, y), \tag {1} +$$ + +where the upper- and inner-level functions $f$ and $g$ are both jointly continuously differentiable. The goal of eq. (1) is to minimize the objective function $\Phi(x)$ with respect to (w.r.t.) $x$ , where $y^*(x)$ is obtained by solving the lower-level minimization problem. In this paper, we focus on the setting where the lower-level function $g$ is strongly convex w.r.t. $y$ , and the upper-level objective function $\Phi(x)$ is nonconvex. Such geometrics commonly exist in many applications such as meta-learning and hyperparameter optimization, where $g$ corresponds to an empirical loss with a strongly-convex regularizer and $x$ are parameters of neural networks. + +A broad collection of algorithms have been proposed to solve bilevel optimization problems. For example, Hansen et al. 1992; Shi et al. 2005; Moore 2010 reformulated the bilevel problem in eq. (1) into a single-level constrained problem based on the optimality conditions of the lower-level problem. However, such type of methods often involve a large number of constraints, and are hard to implement in machine learning applications. Recently, more efficient gradient-based bilevel optimization algorithms have been proposed, which can be generally categorized into the approximate implicit differentiation (AID) based approach (Domke, 2012; Pedregosa, 2016; Gould et al., 2016; Liao et al., 2018; Ghadimi & Wang, 2018; Grazzi et al., 2020; Lorraine et al., 2020) and the iterative differentiation (ITD) based approach (Domke, 2012; Maclaurin et al., 2015; Franceschi et al., 2017; Shaban et al., 2019; Grazzi et al., 2020). However, most of these studies have focused on the asymptotic convergence analysis, and the nonasymptotic convergence rate analysis (that characterizes how fast an algorithm converges) has not been well explored except a few attempts recently. Ghadimi & Wang 2018 provided the convergence rate analysis for the ITD-based approach. Grazzi et al. 2020 provided the iteration complexity for the hypergradient computation via ITD and AID, but did not + +characterize the convergence rate for the entire execution of algorithms. + +- Thus, the first focus of this paper is to develop a comprehensive and sharper theory, which covers a broader class of bilevel optimizers via ITD and AID techniques, and more importantly, improves existing analysis with a more practical parameter selection and orderwisely lower computational complexity. + +The stochastic bilevel optimization often occurs in applications where fresh data are sampled for algorithm iterations (e.g., in reinforcement learning (Hong et al., 2020)) or the sample size of training data is large (e.g., hyperparameter optimization (Franceschi et al., 2018), Stackelberg game (Roth et al., 2016)). Typically, the objective function is given by + +$$ +\begin{array}{l} \min _ {x \in \mathbb {R} ^ {p}} \Phi (x) = f (x, y ^ {*} (x)) = \left\{ \begin{array}{l} \frac {1}{n} \sum_ {i = 1} ^ {n} F (x, y ^ {*} (x); \xi_ {i}) \\ \mathbb {E} _ {\xi} [ F (x, y ^ {*} (x); \xi) ] \end{array} \right. \\ \text {s . t .} y ^ {*} (x) = \underset {y \in \mathbb {R} ^ {q}} {\arg \min } g (x, y) = \left\{ \begin{array}{l} \frac {1}{m} \sum_ {i = 1} ^ {m} G (x, y; \zeta_ {i}) \\ \mathbb {E} _ {\zeta} [ G (x, y; \zeta) ] \end{array} \right. \tag {2} \\ \end{array} +$$ + +where $f(x,y)$ and $g(x,y)$ take either the expectation form w.r.t. the random variables $\xi$ and $\zeta$ or the finite-sum form over given data $\mathcal{D}_{n,m} = \{\xi_i, \zeta_j, i = 1, \dots, n; j = 1, \dots, m\}$ often with large sizes $n$ and $m$ . During the optimization process, data batch is sampled via the distributions of $\xi$ and $\zeta$ or from the set $\mathcal{D}_{n,m}$ . For such a stochastic setting, Ghadimi & Wang 2018 proposed a bilevel stochastic approximation (BSA) method via single-sample gradient and Hessian estimates. Based on such a method, Hong et al. 2020 further proposed a two-timescale stochastic approximation (TTSA) algorithm, and showed that TTSA achieves a better trade-off between the complexities of inner- and outer-loop optimization stages than BSA. + +- The second focus of this paper is to design a more sample-efficient algorithm for bilevel stochastic optimization, which achieves lower computational complexity by orders of magnitude than BSA and TTSA. + +# 1.1. Main Contributions + +Our main contributions lie in developing shaper theory and provably faster algorithms for nonconvex-strongly-convex bilevel deterministic and stochastic optimization problems, respectively. Our analysis involves several new developments, which can be of independent interest. + +We first provide a unified convergence rate and complexity analysis for both ITD and AID based bilevel optimizers, which we call as ITD-BiO and AID-BiO. Compared to existing analysis in Ghadimi & Wang 2018 for AID-BiO that requires a continuously increasing number of inner-loop + +steps to achieve the guarantee, our analysis allows a constant number of inner-loop steps as often used in practice. In addition, we introduce a warm start initialization for the inner-loop updates and the outer-loop hypergradient estimation, which allows us to backpropagate the tracking errors to previous loops, and yields an improved computational complexity. As shown in Table 1, the gradient complexities $\mathrm{Gc}(f,\epsilon)$ , $\mathrm{Gc}(g,\epsilon)$ , and Jacobian- and Hessian-vector product complexities $\mathrm{JV}(g,\epsilon)$ and $\mathrm{HV}(g,\epsilon)$ of AID-BiO to attain an $\epsilon$ -accurate stationary point improve those of Ghadimi & Wang 2018 by the order of $\kappa$ , $\kappa \epsilon^{-1/4}$ , $\kappa$ , and $\kappa$ , respectively, where $\kappa$ is the condition number. In addition, our analysis shows that AID-BiO requires less computations of Jacobian- and Hessian-vector products than ITD-BiO by an order of $\kappa$ and $\kappa^{1/2}$ , which implies that AID can be more computationally and memory efficient than ITD. + +We then propose a stochastic bilevel optimizer (stocBiO) to solve the stochastic bilevel optimization problem in eq. (2). Our algorithm features a mini-batch hypergradient estimation via implicit differentiation, where the core design involves a sample-efficient hypergradient estimator via the Neumann series. As shown in Table 2, the gradient complexities of our proposed algorithm w.r.t. $F$ and $G$ improve upon those of BSA (Ghadimi & Wang, 2018) by an order of $\kappa$ and $\epsilon^{-1}$ , respectively. In addition, the Jacobian-vector product complexity $\mathrm{JV}(G,\epsilon)$ of our algorithm improves that of BSA by an order of $\kappa$ . In terms of the target accuracy $\epsilon$ , our computational complexities improve those of TTSA (Hong et al., 2020) by an order of $\epsilon^{-1/2}$ . + +Our results further provide the theoretical complexity guarantee for ITD-BiO, AID-BiO and stocBiO in meta-learning and hyperparameter optimization. The experiments validate our theoretical results for deterministic bilevel optimization, and demonstrate the superior efficiency of stocBiO for stochastic bilevel optimization. + +# 1.2. Related Work + +Bilevel optimization approaches: Bilevel optimization was first introduced by Bracken & McGill 1973. Since then, a number of bilevel optimization algorithms have been proposed, which include but not limited to constraint-based methods (Shi et al., 2005; Moore, 2010) and gradient-based methods (Domke, 2012; Pedregosa, 2016; Gould et al., 2016; Maclaurin et al., 2015; Franceschi et al., 2018; Ghadimi & Wang, 2018; Liao et al., 2018; Shaban et al., 2019; Hong et al., 2020; Liu et al., 2020; Li et al., 2020; Grazzi et al., 2020; Lorraine et al., 2020; Ji & Liang, 2021). Among them, Ghadimi & Wang 2018; Hong et al. 2020 provided the complexity analysis for their proposed methods for the nonconvex-strongly-convex bilevel optimization problem. For such a problem, this paper develops a general and enhanced convergence rate analysis for gradient-based + +Table 1. Comparison of bilevel deterministic optimization algorithms. + +
AlgorithmGc(f,ε)Gc(g,ε)JV(g,ε)HV(g,ε)
AID-BiO (Ghadimi & Wang, 2018)O(κ4ε-1)O(κ5ε-5/4)O(κ4ε-1)O(κ4.5ε-1)
AID-BiO (this paper)O(κ3ε-1)O(κ4ε-1)O(κ3ε-1)O(κ3.5ε-1)
ITD-BiO (this paper)O(κ3ε-1)O(κ4ε-1)O(κ4ε-1)O(κ4ε-1)
+ +$\operatorname{Gc}(f, \epsilon)$ and $\operatorname{Gc}(g, \epsilon)$ : number of gradient evaluations w.r.t. $f$ and $g$ . $\kappa$ : condition number. $\operatorname{JV}(g, \epsilon)$ : number of Jacobian-vector products $\nabla_x \nabla_y g(x, y)v$ . Notation $\widetilde{\mathcal{O}}$ : omit $\log \frac{1}{\epsilon}$ terms. $\operatorname{HV}(g, \epsilon)$ : number of Hessian-vector products $\nabla_y^2 g(x, y)v$ . + +Table 2. Comparison of bilevel stochastic optimization algorithms. + +
AlgorithmGc(F, ε)Gc(G, ε)JV(G, ε)HV(G, ε)
TTSA (Hong et al., 2020)O(poly(κ)ε-5/2)*O(poly(κ)ε-5/2)O(poly(κ)ε-5/2)O(poly(κ)ε-5/2)
BSA (Ghadimi & Wang, 2018)O(κ6ε-2)O(κ9ε-3)O(κ6ε-2)O(κ6ε-2)
stocBiO (this paper)O(κ5ε-2)O(κ9ε-2)O(κ5ε-2)O(κ6ε-2)
+ +* We use poly(κ) because Hong et al. 2020 does not provide the explicit dependence on κ. + +bilevel optimizers for the deterministic setting, and proposes a novel algorithm for the stochastic setting with order-level lower computational complexity than the existing results. + +Other types of loss geometries have also been studied. For example, Liu et al. 2020; Li et al. 2020 assumed that the lower- and upper-level functions $g(x,\cdot)$ and $f(x,\cdot)$ are convex and strongly convex, and provided an asymptotic analysis for their methods. Ghadimi & Wang 2018; Hong et al. 2020 studied the setting where $\Phi(\cdot)$ is strongly convex or convex, and $g(x,\cdot)$ is strongly convex. + +Bilevel optimization in meta-learning: Bilevel optimization framework has been successfully applied to meta-learning recently (Snell et al., 2017; Franceschi et al., 2018; Rajeswaran et al., 2019; Zügner & Gunnemann, 2019; Ji et al., 2020a,b). For example, Snell et al. 2017 proposed a bilevel optimization procedure for meta-learning to learn a common embedding model for all tasks. Rajeswaran et al. 2019 reformulated the model-agnostic meta-learning (MAML) (Finn et al., 2017) as bilevel optimization, and proposed iMAML via implicit gradient. Our work provides a theoretical guarantee for two popular types of bilevel optimizer, i.e., AID-BiO and ITD-BiO, for meta-learning. + +Bilevel optimization in hyperparameter optimization: Hyperparameter optimization has become increasingly important as a powerful tool in the automatic machine learning (autoML) (Okuno et al., 2018; Yu & Zhu, 2020). Recently, various bilevel optimization algorithms have been proposed for hyperparameter optimization, which include implicit differentiation based methods (Pedregosa, 2016), dynamical system based methods via reverse or forward gradient computation (Franceschi et al., 2017; 2018; Shaban et al., 2019), etc. Our work demonstrates superior efficiency of the proposed stocBiO algorithm in hyperparameter optimization. + +# 2. Algorithms + +In this section, we describe two popular types of deterministic bilevel optimization algorithms, and propose a new algorithm for stochastic bilevel optimization. + +# 2.1. Algorithms for Deterministic Bilevel Optimization + +As shown in Algorithm 1, we describe two popular types of deterministic bilevel optimizers respectively based on AID and ITD (referred to as AID-BiO and ITD-BiO) for solving the problem eq. (1). + +Both AID-BiO and ITD-BiO update in a nested-loop manner. In the inner loop, both of them run $D$ steps of gradient decent (GD) to find an approximation point $y_{k}^{D}$ close to $y^{*}(x_{k})$ . Note that we choose the initialization $y_{k}^{0}$ of each inner loop as the output $y_{k-1}^{D}$ of the preceding inner loop rather than a random start. Such a warm start allows us to backpropagate the tracking error $\| y_{k}^{D} - y^{*}(x_{k}) \|$ to previous loops, and yields an improved computational complexity. + +At the outer loop, AID-BiO first solves $v_{k}^{N}$ from a linear system $\nabla_y^2 g(x_k,y_k^D)v = \nabla_yf(x_k,y_k^D)^1$ using $N$ steps of conjugate-gradient (CG) starting from $v_{k}^{0}$ (where we also adopt a warm start with $v_{k}^{0} = v_{k - 1}^{N}$ ), and then constructs + +$$ +\widehat {\nabla} \Phi (x _ {k}) = \nabla_ {x} f (x _ {k}, y _ {k} ^ {T}) - \nabla_ {x} \nabla_ {y} g (x _ {k}, y _ {k} ^ {T}) v _ {k} ^ {N} \tag {3} +$$ + +as an estimate of the true hypergradient $\nabla \Phi (x_k)$ , whose form is given by the following proposition. + +Proposition 1. Hypergradient $\nabla \Phi (x_k)$ takes the forms of + +$$ +\nabla \Phi (x _ {k}) = \nabla_ {x} f (x _ {k}, y ^ {*} (x _ {k})) - \nabla_ {x} \nabla_ {y} g (x _ {k}, y ^ {*} (x _ {k})) v _ {k} ^ {*}, \tag {4} +$$ + +![](images/b11b705fc8a7e6a57b0a15cf3e4b74c32e28b9d0d4efec824d2ae3de39ab6160.jpg) +Figure 1. Illustration of hyperparameter estimation in our proposed stocBiO algorithm. Note that the hyperparameter estimation (lines 9-10 in Algorithm 2) involves only computations of automatic differentiation over scalar $< G_{j}(y), r_{i} >$ w.r.t. $y$ . In addition, our implementation applies the function torch.autograd.grad in PyTorch, which automatically determines the size of Jacobians. More details can be found in our code via https://github.com/JunjieYang97/StocBio_hp. + +Algorithm 1 Bilevel algorithms via AID or ITD +1: Input: $K, D, N$ , stepsizes $\alpha, \beta$ , initializations $x_0, y_0, v_0$ . +2: for $k = 0, 1, 2, \ldots, K$ do +3: Set $y_k^0 = y_{k-1}^D$ if $k > 0$ and $y_0$ otherwise +4: for $t = 1, \ldots, D$ do +5: Update $y_k^t = y_k^{t-1} - \alpha \nabla_y g(x_k, y_k^{t-1})$ +6: end for +7: Hypergradient estimation via +AID: 1) set $v_k^0 = v_{k-1}^N$ if $k > 0$ and $v_0$ otherwise +2) solve $v_k^N$ from $\nabla_y^2 g(x_k, y_k^D)v = \nabla_y f(x_k, y_k^D)$ via $N$ steps of CG starting from $v_k^0$ . +3) get Jacobian-vector product $\nabla_x \nabla_y g(x_k, y_k^D)v_k^N$ via automatic differentiation +4) $\widehat{\nabla}\Phi(x_k) = \nabla_x f(x_k, y_k^D) - \nabla_x \nabla_y g(x_k, y_k^D)v_k^N$ +ITD: compute $\widehat{\nabla}\Phi(x_k) = \frac{\partial f(x_k, y_k^D)}{\partial x_k}$ via backpropagation +8: Update $x_{k+1} = x_k - \beta \widehat{\nabla}\Phi(x_k)$ +9: end for + +where $v_{k}^{*}$ is the solution of the following linear system + +$$ +\nabla_ {y} ^ {2} g (x _ {k}, y ^ {*} (x _ {k})) v = \nabla_ {y} f (x _ {k}, y ^ {*} (x _ {k})). +$$ + +As shown in Domke 2012; Grazzi et al. 2020, the construction of eq. (3) involves only Hessian-vector products in solving $v_{N}$ via CG and Jacobian-vector product $\nabla_{x}\nabla_{y}g(x_{k},y_{k}^{D})v_{k}^{N}$ , which can be efficiently computed and stored via existing automatic differentiation packages. + +As a comparison, the outer loop of ITD-BiO computes the gradient $\frac{\partial f(x_k,y_k^D(x_k))}{\partial x_k}$ as an approximation of the hypergradient $\nabla \Phi (x_{k}) = \frac{\partial f(x_{k},y^{*}(x_{k}))}{\partial x_{k}}$ via backpropagation, where we write $y_{k}^{D}(x_{k})$ because the output $y_{k}^{D}$ of the inner loop has a dependence on $x_{k}$ through the inner-loop + +iterative GD updates. The explicit form of the estimate $\frac{\partial f(x_k,y_k^D(x_k))}{\partial x_k}$ is given by the following proposition via the chain rule. For notation simplification, let $\prod_{j = D}^{D - 1}(\cdot) = I$ + +Proposition 2. $\frac{\partial f(x_k, y_k^D(x_k))}{\partial x_k}$ takes the analytical form of: + +$$ +\begin{array}{l} \frac {\partial f (x _ {k} , y _ {k} ^ {D})}{\partial x _ {k}} = \nabla_ {x} f (x _ {k}, y _ {k} ^ {D}) - \alpha \sum_ {t = 0} ^ {D - 1} \nabla_ {x} \nabla_ {y} g (x _ {k}, y _ {k} ^ {t}) \\ \times \prod_ {j = t + 1} ^ {D - 1} (I - \alpha \nabla_ {y} ^ {2} g (x _ {k}, y _ {k} ^ {j})) \nabla_ {y} f (x _ {k}, y _ {k} ^ {D}). \\ \end{array} +$$ + +Proposition 2 shows that the differentiation involves the computations of second-order derivatives such as Hessian $\nabla_y^2 g(\cdot, \cdot)$ . Since efficient Hessian-free methods have been successfully deployed in the existing automatic differentiation tools, computing these second-order derivatives reduces to more efficient computations of Jacobian- and Hessian-vector products. + +# 2.2. Algorithm for Stochastic Bilevel Optimization + +We propose a new stochastic bilevel optimizer (stocBiO) in Algorithm 2 to solve the problem eq. (2). It has a double-loop structure similar to Algorithm 1, but runs $D$ steps of stochastic gradient decent (SGD) at the inner loop to obtain an approximated solution $y_{k}^{D}$ . Based on the output $y_{k}^{D}$ of the inner loop, stocBiO first computes a gradient $\nabla_{y}F(x_{k},y_{k}^{D};\mathcal{D}_{F})$ over a sample batch $\mathcal{D}_F$ , and then computes a vector $v_{Q}$ as an estimated solution of the linear system $\nabla_y^2 g(x_k,y^* (x_k))v = \nabla_yf(x_k,y^* (x_k))$ via Algorithm 3. Here, $v_{Q}$ takes a form of + +$$ +v _ {Q} = \eta \sum_ {q = - 1} ^ {Q - 1} \prod_ {j = Q - q} ^ {Q} \left(I - \eta \nabla_ {y} ^ {2} G \left(x _ {k}, y _ {k} ^ {D}; \mathcal {B} _ {j}\right)\right) v _ {0}, \tag {5} +$$ + +Algorithm 2 Stochastic bilevel optimizer (stocBiO) +1: Input: $K, D, Q$ , stepsizes $\alpha$ and $\beta$ , initializations $x_0$ and $y_0$ . +2: for $k = 0, 1, 2, \dots, K$ do +3: Set $y_k^0 = y_{k-1}^D$ if $k > 0$ and $y_0$ otherwise +4: for $t = 1, \dots, D$ do +5: Draw a sample batch $S_{t-1}$ +6: Update $y_k^t = y_k^{t-1} - \alpha \nabla_y G(x_k, y_k^{t-1}; S_{t-1})$ +7: end for +8: Draw sample batches $\mathcal{D}_F, \mathcal{D}_H$ and $\mathcal{D}_G$ +9: Compute gradient $v_0 = \nabla_y F(x_k, y_k^D; \mathcal{D}_F)$ +10: Construct estimate $v_Q$ via Algorithm 3 given $v_0$ +11: Compute $\nabla_x \nabla_y G(x_k, y_k^D; \mathcal{D}_G) v_Q$ +12: Compute gradient estimate $\widehat{\nabla} \Phi(x_k)$ via eq. (6) +13: Update $x_{k+1} = x_k - \beta \widehat{\nabla} \Phi(x_k)$ +14: end for + +Algorithm 3 Construct $v_{Q}$ given $v_{0}$ +1: Input: Integer $Q$ samples $\mathcal{D}_H = \{\mathcal{B}_j\}_{j = 1}^Q$ and constant $\eta$ +2: for $j = 1,2,\ldots ,Q$ do +3: Sample $\mathcal{B}_j$ and compute $G_{j}(y) = y - \eta \nabla_{y}G(x,y;\mathcal{B}_{j})$ +4: end for +5: Set $r_Q = v_0$ +6: for $i = Q,\dots,1$ do +7: $r_{i - 1} = \partial (G_i(y)r_i) / \partial y = r_i - \eta \nabla_y^2 G(x,y;\mathcal{B}_i)r_i$ via automatic differentiation +8: end for +9: Return $v_{Q} = \eta \sum_{i = 0}^{Q}r_{i}$ + +where $v_{0} = \nabla_{y}F(x_{k},y_{k}^{D};\mathcal{D}_{F})$ , $\{\mathcal{B}_j,j = 1,\dots ,Q\}$ are mutually-independent sample sets, $Q$ and $\eta$ are constants, and we let $\prod_{Q + 1}^{Q}(\cdot) = I$ for notational simplification. Our construction of $v_{Q}$ , i.e., Algorithm 3, is motivated by the Neumann series $\sum_{i = 0}^{\infty}U^{k} = (I - U)^{-1}$ , and involves only Hessian-vector products rather than Hessians, and hence is computationally and memory efficient. This procedure is illustrated in Figure 1. + +Then, we construct + +$$ +\widehat {\nabla} \Phi (x _ {k}) = \nabla_ {x} F (x _ {k}, y _ {k} ^ {D}; \mathcal {D} _ {F}) - \nabla_ {x} \nabla_ {y} G (x _ {k}, y _ {k} ^ {D}; \mathcal {D} _ {G}) v _ {Q} \tag {6} +$$ + +as an estimate of hypergradient $\nabla \Phi (x_k)$ . Compared to the deterministic case, it is more challenging to design a sample-efficient Hypergradient estimator in the stochastic case. For example, instead of choosing the same batch sizes for all $\mathcal{B}_j$ , $j = 1,\ldots ,Q$ in eq. (5), our analysis captures the different impact of components $\nabla_y^2 G(x_k,y_k^D;\mathcal{B}_j)$ , $j = 1,\ldots ,Q$ on the hypergradient estimation variance, and inspires an adaptive and more efficient choice by setting $|\mathcal{B}_{Q - j}|$ to decay exponentially with $j$ from 0 to $Q - 1$ . By doing so, we achieve an improved complexity. + +# 3. Definitions and Assumptions + +Let $z = (x,y)$ denote all parameters. For simplicity, suppose sample sets $\mathcal{S}_t$ for all $t = 0,\dots,D - 1$ , $\mathcal{D}_G$ and $\mathcal{D}_F$ have the sizes of $S$ , $D_g$ and $D_f$ , respectively. In this paper, + +we focus on the following types of loss functions for both the deterministic and stochastic cases. + +Assumption 1. The lower-level function $g(x,y)$ is $\mu$ -strongly-convex w.r.t. $y$ and the total objective function $\Phi (x) = f(x,y^{*}(x))$ is nonconvex w.r.t. $x$ . For the stochastic setting, the same assumptions hold for $G(x,y;\zeta)$ and $\Phi (x)$ , respectively. + +Since $\Phi(x)$ is nonconvex, algorithms are expected to find an $\epsilon$ -accurate stationary point defined as follows. + +Definition 1. We say $\bar{x}$ is an $\epsilon$ -accurate stationary point for the objective function $\Phi(x)$ in eq. (2) if $\mathbb{E}\|\nabla\Phi(\bar{x})\|^2 \leq \epsilon$ where $\bar{x}$ is the output of an algorithm. + +In order to compare the performance of different bilevel algorithms, we adopt the following metrics of complexity. + +Definition 2. For a function $f(x,y)$ and a vector $v$ , let $\mathrm{Gc}(f,\epsilon)$ be the number of the partial gradient $\nabla_x f$ or $\nabla_y f$ , and let $\mathrm{JV}(g,\epsilon)$ and $\mathrm{HV}(g,\epsilon)$ be the number of Jacobian-vector products $\nabla_x \nabla_y g(x,y)v$ and Hessian-vector products $\nabla_y^2 g(x,y)v$ . For the stochastic case, similar metrics are adopted but w.r.t. the stochastic function $F(x,y;\xi)$ . + +We take the following standard assumptions on the loss functions in eq. (2), which have been widely adopted in bilevel optimization (Ghadimi & Wang, 2018; Ji et al., 2020a). + +Assumption 2. The loss function $f(z)$ and $g(z)$ satisfy + +- The function $f(z)$ is $M$ -Lipschitz, i.e., for any $z, z'$ , + +$$ +\left| f (z) - f \left(z ^ {\prime}\right) \right| \leq M \| z - z ^ {\prime} \|. +$$ + +- $\nabla f(z)$ and $\nabla g(z)$ are $L$ -Lipschitz, i.e., for any $z, z'$ , + +$$ +\| \nabla f (z) - \nabla f \left(z ^ {\prime}\right) \| \leq L \| z - z ^ {\prime} \|, +$$ + +$$ +\| \nabla g (z) - \nabla g \left(z ^ {\prime}\right) \| \leq L \| z - z ^ {\prime} \|. +$$ + +For the stochastic case, the same assumptions hold for $F(z;\xi)$ and $G(z;\zeta)$ for any given $\xi$ and $\zeta$ . + +As shown in Proposition 1, the gradient of the objective function $\Phi(x)$ involves the second-order derivatives $\nabla_x \nabla_y g(z)$ and $\nabla_y^2 g(z)$ . The following assumption imposes the Lipschitz conditions on such high-order derivatives, as also made in Ghadimi & Wang 2018. + +Assumption 3. Suppose the derivatives $\nabla_x\nabla_yg(z)$ and $\nabla_y^2 g(z)$ are $\tau$ - and $\rho$ -Lipschitz, i.e., + +- For any $z, z'$ , $\|\nabla_x \nabla_y g(z) - \nabla_x \nabla_y g(z')\| \leq \tau \|z - z'\|$ . +For any $z,z^{\prime}$ $\| \nabla_y^2 g(z) - \nabla_y^2 g(z')\| \leq \rho \| z - z'\|$ + +For the stochastic case, the same assumptions hold for $\nabla_{x}\nabla_{y}G(z;\zeta)$ and $\nabla_y^2 G(z;\zeta)$ for any $\zeta$ . + +As typically adopted in the analysis for stochastic optimization, we make the following bounded-variance assumption for the lower-level stochastic function $G(z;\zeta)$ . + +Assumption 4. Gradient $\nabla G(z;\zeta)$ has a bounded variance, i.e., $\mathbb{E}_{\xi}\| \nabla G(z;\zeta) - \nabla g(z)\| ^2\leq \sigma^2$ for some $\sigma$ + +# 4. Main Results for Bilevel Optimization + +# 4.1. Deterministic Bilevel Optimization + +We first characterize the convergence and complexity of AID-BiO. Let $\kappa = \frac{L}{\mu}$ denote the condition number. + +Theorem 1 (AID-BiO). Suppose Assumptions 1, 2, 3 hold. Define a smoothness parameter $L_{\Phi} = L + \frac{2L^2 + \tau M^2}{\mu} + \frac{\rho LM + L^3 + \tau ML}{\mu^2} + \frac{\rho L^2M}{\mu^3} = \Theta(\kappa^3)$ , choose the stepsizes $\alpha \leq \frac{1}{L}$ , $\beta = \frac{1}{8L_{\Phi}}$ , and set the inner-loop iteration number $D \geq \Theta(\kappa)$ and the CG iteration number $N \geq \Theta(\sqrt{\kappa})$ , where the detailed forms of $D, N$ can be found in Appendix $E$ . Then, the outputs of AID-BiO satisfy + +$$ +\frac {1}{K} \sum_ {k = 0} ^ {K - 1} \| \nabla \Phi (x _ {k}) \| ^ {2} \leq \frac {6 4 L _ {\Phi} (\Phi (x _ {0}) - \inf _ {x} \Phi (x)) + 5 \Delta_ {0}}{K}, +$$ + +where $\Delta_0 = \| y_0 - y^* (x_0)\| ^2 +\| v_0^* -v_0\| ^2 >0$ + +In order to achieve an $\epsilon$ -accurate stationary point, the complexities satisfy + +Gradient: $\operatorname{Gc}(f, \epsilon) = \mathcal{O}(\kappa^3 \epsilon^{-1}), \operatorname{Gc}(g, \epsilon) = \mathcal{O}(\kappa^4 \epsilon^{-1})$ . +- Jacobian- and Hessian-vector product complexities: $\mathrm{JV}(g,\epsilon) = \mathcal{O}\left(\kappa^{3}\epsilon^{-1}\right),\mathrm{HV}(g,\epsilon) = \mathcal{O}\left(\kappa^{3.5}\epsilon^{-1}\right)$ . + +As shown in Table 1, the complexities $\mathrm{Gc}(f,\epsilon),\mathrm{Gc}(g,\epsilon)$ $\mathrm{JV}(g,\epsilon)$ and $\mathrm{HV}(g,\epsilon)$ of our analysis improves that of Ghadimi & Wang 2018 (eq. (2.30) therein) by the order of $\kappa ,\kappa \epsilon^{-1 / 4},\kappa$ and $\kappa$ . Such an improvement is achieved by a refined analysis with a constant number of inner-loop steps, and by a warm start strategy to backpropagate the tracking errors $\| y_k^D -y^* (x_k)\|$ and $\| v_k^N -v_k^*\|$ to previous loops, as also demonstrated by our meta-learning experiments. We next characterize the convergence and complexity performance of the ITD-BiO algorithm. + +Theorem 2 (ITD-BiO). Suppose Assumptions 1, 2, and 3 hold. Define $L_{\Phi}$ as in Theorem 1, and choose $\alpha \leq \frac{1}{L}$ , $\beta = \frac{1}{4L_{\Phi}}$ and $D \geq \Theta (\kappa \log \frac{1}{\epsilon})$ , where the detailed form of $D$ can be found in Appendix F. Then, we have + +$$ +\frac {1}{K} \sum_ {k = 0} ^ {K - 1} \| \nabla \Phi (x _ {k}) \| ^ {2} \leq \frac {1 6 L _ {\Phi} (\Phi (x _ {0}) - \inf _ {x} \Phi (x))}{K} + \frac {2 \epsilon}{3}. +$$ + +In order to achieve an $\epsilon$ -accurate stationary point, the complexities satisfy + +Gradient: $\operatorname {Gc}(f,\epsilon) = \mathcal{O}(\kappa^3\epsilon^{-1}),\operatorname {Gc}(g,\epsilon) = \widetilde{\mathcal{O}} (\kappa^4\epsilon^{-1}).$ +- Jacobian- and Hessian-vector product complexity: $\mathrm{JV}(g,\epsilon) = \widetilde{\mathcal{O}}\big(\kappa^4\epsilon^{-1}\big),\mathrm{HV}(g,\epsilon) = \widetilde{\mathcal{O}}\big(\kappa^4\epsilon^{-1}\big).$ + +By comparing Theorem 1 and Theorem 2, it can be seen that the complexities $\mathrm{JV}(g,\epsilon)$ and $\mathrm{HV}(g,\epsilon)$ of AID-BiO are better than those of ITD-BiO by the order of $\kappa$ and $\kappa^{0.5}$ , which implies that AID-BiO is more computationally and memory efficient than ITD-BiO, as verified in Figure 2. + +# 4.2. Stochastic Bilevel Optimization + +We first characterize the bias and variance of an important component $v_{Q}$ in eq. (5). + +Proposition 3. Suppose Assumptions 1, 2 and 3 hold. Let $\eta \leq \frac{1}{L}$ and choose $|\mathcal{B}_{Q + 1 - j}| = BQ(1 - \eta \mu)^{j - 1}$ for $j = 1,\dots ,Q$ , where $B\geq \frac{1}{Q(1 - \eta\mu)^{Q - 1}}$ . Then, the bias satisfies + +$$ +\begin{array}{l} \left| \left| \mathbb {E} v _ {Q} - \left[ \nabla_ {y} ^ {2} g \left(x _ {k}, y _ {k} ^ {D}\right) \right] ^ {- 1} \nabla_ {y} f \left(x _ {k}, y _ {k} ^ {D}\right) \right| \right| \\ \leq \mu^ {- 1} (1 - \eta \mu) ^ {Q + 1} M. \tag {7} \\ \end{array} +$$ + +Furthermore, the estimation variance is given by + +$$ +\begin{array}{l} \mathbb {E} \| v _ {Q} - \left[ \nabla_ {y} ^ {2} g \left(x _ {k}, y _ {k} ^ {D}\right) \right] ^ {- 1} \nabla_ {y} f \left(x _ {k}, y _ {k} ^ {D}\right) \| ^ {2} \\ \leq \frac {4 \eta^ {2} L ^ {2} M ^ {2}}{\mu^ {2}} \frac {1}{B} + \frac {4 (1 - \eta \mu) ^ {2 Q + 2} M ^ {2}}{\mu^ {2}} + \frac {2 M ^ {2}}{\mu^ {2} D _ {f}}. \tag {8} \\ \end{array} +$$ + +Proposition 3 shows that if we choose $Q, B$ and $D_{f}$ at the order level of $\mathcal{O}(\log \frac{1}{\epsilon})$ , $\mathcal{O}(1 / \epsilon)$ and $\mathcal{O}(1 / \epsilon)$ , the bias and variance are smaller than $\mathcal{O}(\epsilon)$ , and the required number of samples is $\sum_{j = 1}^{Q}BQ(1 - \eta \mu)^{j - 1} = \mathcal{O}\left(\epsilon^{-1}\log \frac{1}{\epsilon}\right)$ . Note that the chosen batch size $|\mathcal{B}_{Q + 1 - j}|$ exponentially decays w.r.t. the index $j$ . In comparison, the uniform choice of all $|\mathcal{B}_j|$ would yield a worse complexity of $\mathcal{O}\big(\epsilon^{-1}(\log \frac{1}{\epsilon})^2\big)$ . + +We next analyze stocBiO when $\Phi (x)$ is nonconvex. + +Theorem 3. Suppose Assumptions 1, 2, 3 and 4 hold. Define $L_{\Phi} = L + \frac{2L^2 + \tau M^2}{\mu} + \frac{\rho LM + L^3 + \tau ML}{\mu^2} + \frac{\rho L^2M}{\mu^3}$ , and choose $\beta = \frac{1}{4L_{\Phi}}$ , $\eta < \frac{1}{L}$ , and $D \geq \Theta(\kappa \log \kappa)$ , where the detailed form of $D$ can be found in Appendix G.3. We have + +$$ +\begin{array}{l} \frac {1}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \| \nabla \Phi (x _ {k}) \| ^ {2} \leq \mathcal {O} \left(\frac {L _ {\Phi}}{K} + \kappa^ {2} (1 - \eta \mu) ^ {2 Q} \right. \\ \left. + \frac {\kappa^ {5} \sigma^ {2}}{S} + \frac {\kappa^ {2}}{D _ {g}} + \frac {\kappa^ {2}}{D _ {f}} + \frac {\kappa^ {2}}{B}\right). \tag {9} \\ \end{array} +$$ + +In order to achieve an $\epsilon$ -accurate stationary point, the complexities satisfy + +- Gradient: $\operatorname{Gc}(F, \epsilon) = \mathcal{O}(\kappa^5 \epsilon^{-2})$ , $\operatorname{Gc}(G, \epsilon) = \mathcal{O}(\kappa^9 \epsilon^{-2})$ . +- Jacobian- and Hessian-vector product complexities: $\mathrm{JV}(G,\epsilon) = \mathcal{O}(\kappa^5\epsilon^{-2}),\mathrm{HV}(G,\epsilon) = \widetilde{\mathcal{O}} (\kappa^6\epsilon^{-2}).$ + +Theorem 3 shows that stocBiO converges sublinearly with the convergence error decaying exponentially w.r.t. $Q$ and sublinearly w.r.t. the batch sizes $S, D_g, D_f$ for gradient estimation and $B$ for Hessian inverse estimation. In addition, it + +can be seen that the number $D$ of the inner-loop steps is at a constant level, rather than a typical choice of $\Theta (\log (\frac{1}{\epsilon}))$ + +As shown in Table 2, the gradient complexities of our proposed algorithm in terms of $F$ and $G$ improve those of BSA in Ghadimi & Wang 2018 by an order of $\kappa$ and $\epsilon^{-1}$ , respectively. In addition, the Jacobian-vector product complexity $\mathrm{JV}(G,\epsilon)$ of our algorithm improves that of BSA by the order of $\kappa$ . In terms of the accuracy $\epsilon$ , our gradient, Jacobian- and Hessian-vector product complexities improve those of TTSA in Hong et al. 2020 all by an order of $\epsilon^{-0.5}$ . + +# 5. Applications to Meta-Learning + +Consider the few-shot meta-learning problem with $m$ tasks $\{\mathcal{T}_i, i = 1, \dots, m\}$ sampled from distribution $P_{\mathcal{T}}$ . Each task $\mathcal{T}_i$ has a loss function $\mathcal{L}(\phi, w_i; \xi)$ over each data sample $\xi$ , where $\phi$ are the parameters of an embedding model shared by all tasks, and $w_i$ are the task-specific parameters. The goal of this framework is to find good parameters $\phi$ for all tasks, and building on the embedded features, each task then adapts its own parameters $w_i$ by minimizing its loss. + +The model training takes a bilevel procedure. In the lower-level stage, building on the embedded features, the base learner of task $\mathcal{T}_i$ searches $w_i^*$ as the minimizer of its loss over a training set $S_{i}$ . In the upper-level stage, the metalearner evaluates the minimizers $w_{i}^{*}, i = 1,\dots,m$ on held-out test sets, and optimizes $\phi$ of the embedding model over all tasks. Let $\widetilde{w} = (w_{1},\ldots ,w_{m})$ denote all task-specific parameters. Then, the objective function is given by + +$$ +\min_{\phi}\mathcal{L}_{\mathcal{D}}(\phi ,\widetilde{w}^{*}) = \frac{1}{m}\sum_{i = 1}^{m}\underbrace{\frac{1}{|\mathcal{D}_{i}|}\sum_{\xi\in\mathcal{D}_{i}}\mathcal{L}(\phi,w_{i}^{*};\xi)}_{\mathcal{L}_{\mathcal{D}_{i}}(\phi ,w_{i}^{*}): \text{task-specific upper-level loss}} +$$ + +$$ +\text {s . t .} \widetilde {w} ^ {*} = \underset {\widetilde {w}} {\arg \min } \mathcal {L} _ {\mathcal {S}} (\phi , \widetilde {w}) = \frac {\sum_ {i = 1} ^ {m} \mathcal {L} _ {\mathcal {S} _ {i}} (\phi , w _ {i})}{m}, \tag {10} +$$ + +where $\mathcal{L}_{\mathcal{S}_i}(\phi, w_i) = \frac{1}{|S_i|} \sum_{\xi \in \mathcal{S}_i} \mathcal{L}(\phi, w_i; \xi) + \mathcal{R}(w_i)$ with a strongly-convex regularizer $\mathcal{R}(w_i)$ , e.g., $L^2$ , and $\mathcal{S}_i, \mathcal{D}_i$ are the training and test datasets of task $\mathcal{T}_i$ . Note that the lower-level problem is equivalent to solving each $w_i^*$ as a minimizer of the task-specific loss $\mathcal{L}_{\mathcal{S}_i}(\phi, w_i)$ for $i = 1, \dots, m$ . In practice, $w_i$ often corresponds to the parameters of the last linear layer of a neural network and $\phi$ are the parameters of the remaining layers (e.g., 4 convolutional layers in Bertinetto et al. 2018; Ji et al. 2020a), and hence the lower-level function is strongly-convex w.r.t. $\widetilde{w}$ and the upper-level function $\mathcal{L}_{\mathcal{D}}(\phi, \widetilde{w}^*(\phi))$ is generally nonconvex w.r.t. $\phi$ . In addition, due to the small sizes of datasets $\mathcal{D}_i$ and $\mathcal{S}_i$ in few-shot learning, all updates for each task $\mathcal{T}_i$ use full gradient descent without data resampling. As a result, AID-BiO and ITD-BiO in Algorithm 1 can be applied here. In some applications where the number $m$ of tasks is large, it is more + +efficient to sample a batch $\mathcal{B}$ of i.i.d. tasks from $\{\mathcal{T}_i,i = 1,\dots,m\}$ at each meta (outer) iteration, and optimizes the mini-batch versions $\mathcal{L}_{\mathcal{D}}(\phi ,\widetilde{w};\mathcal{B}) = \frac{1}{|\mathcal{B}|}\sum_{i\in \mathcal{B}}\mathcal{L}_{\mathcal{D}_i}(\phi ,w_i)$ and $\mathcal{L}_{\mathcal{S}}(\phi ,\widetilde{w};\mathcal{B}) = \frac{1}{|\mathcal{B}|}\sum_{i\in \mathcal{B}}\mathcal{L}_{\mathcal{S}_i}(\phi ,w_i)$ instead. + +We next provide the convergence result of ITD-BiO for this case, and that of AID-BiO can be similarly derived. + +Theorem 4. Suppose Assumptions 1, 2 and 3 hold and suppose each task loss $\mathcal{L}_{S_i}(\phi ,\cdot)$ is $\mu$ -strongly-convex. Choose the same parameters $\beta, D$ as in Theorem 2. Then, we have + +$$ +\frac {1}{K} \sum_ {k = 0} ^ {K - 1} \mathbb {E} \| \nabla \Phi (\phi_ {k}) \| ^ {2} \leq \mathcal {O} \left(\frac {1}{K} + \frac {\kappa^ {2}}{| \mathcal {B} |}\right). +$$ + +Theorem 4 shows that compared to the full batch case (i.e., without task sampling) in eq. (10), task sampling introduces a variance term $\mathcal{O}\left(\frac{1}{|\mathcal{B}|}\right)$ due to the stochastic nature of the algorithm. + +# 5.1. Experiments + +To validate our theoretical results for deterministic bilevel optimization, we compare the performance among the following four algorithms: ITD-BiO, AID-BiO-constant (AID-BiO with a constant number of inner-loop steps as in our analysis), AID-BiO-increasing (AID-BiO with an increasing number of inner-loop steps under analysis in Ghadimi & Wang 2018), and two popular meta-learning algorithms MAML² (Finn et al., 2017) and ANIL³ (Raghu et al., 2019). We conduct experiments over a 5-way 5-shot task on two datasets: FC100 and miniImageNet. The results are averaged over 10 trials with different random seeds. Due to the space limitations, we provide the model architectures and hyperparameter settings in Appendix A. + +It can be seen from Figure 2 that for both the miniImageNet and FC100 datasets, AID-BiO-constant converges faster than AID-BiO-increasing in terms of both the training accuracy and test accuracy, and achieves a better final test accuracy than ANIL and MAML. This demonstrates the superior improvement of our developed analysis over existing analysis in Ghadimi & Wang 2018 for AID-BiO algorithm. Moreover, it can be observed that AID-BiO is slightly faster than ITD-BiO in terms of the training accuracy and test accuracy. This is in consistence with our theoretical results. + +We also compare the robustness between the bilevel optimizer ITD-BiO (AID-BiO performs similarly to ITD-BiO in terms of the convergence rate) and ANIL when the number $T$ (i.e., $D$ in Algorithm 1) of inner-loop steps is relatively large. It can be seen from Figure 3 that when the number + +![](images/8cec29ea6a5b8e40873a626d449306ad1d832b1b0c233402ca80b39e69d9772e.jpg) +(a) dataset: miniImageNet + +![](images/ad306bf3780d335d6514a8638933369779d70a42c91ad66adbe85901c6649483.jpg) + +![](images/49859a01dc191e2343103829a49ba58a1b3c82298923237fae0744cf9cb39a4a.jpg) +(b) dataset: FC100 + +![](images/c1b75f8e5e43867735d038dbfa11f03a3ee367be8f5c4668cc83285d1884c31f.jpg) + +![](images/0cc2a498ac66c49c464b1afcfa4ffe4e48b67000049241728cadef7bc8025d5b.jpg) +Figure 2. Comparison of various bilevel algorithms on meta-learning. For each dataset, left plot: training accuracy v.s. running time; right plot: test accuracy v.s. running time. + +![](images/f75b49b6a53cda19a7a981af72b30d49f0ea851e24bfa208c18e0a8a74bb78d5.jpg) +(a) $T = 10$ , miniImageNet dataset + +![](images/9c89973e60050cf731a31c5e59acf2a2e6c3aeb1f025675f15f9d4eebb92b2ec.jpg) +(b) $T = 20$ ,FC100 dataset + +![](images/31650c3d8a871b2a9c7e2de5702fd4aed821dd34e2d50d839b8359086a3b7792.jpg) +Figure 3. Comparison of ITD-BiO and ANIL with a relatively large inner-loop iteration number $T$ . + +of inner-loop steps is large, i.e., $T = 10$ for miniImageNet and $T = 20$ for FC100, the bilevel optimizer ITD-BiO converges stably with a small variance, whereas ANIL suffers from a sudden descent at 1500s on miniImageNet and even diverges after 2000s on FC100. + +# 6. Applications to Hyperparameter Optimization + +The goal of hyperparameter optimization (Franceschi et al., 2018; Feurer & Hutter, 2019) is to search for representation or regularization parameters $\lambda$ to minimize the validation error evaluated over the learner's parameters $w^{*}$ , where $w^{*}$ is the minimizer of the inner-loop regularized training error. Mathematically, the objective function is given by + +$$ +\begin{array}{l} \min _ {\lambda} \mathcal {L} _ {\mathcal {D} _ {\mathrm {v a l}}} (\lambda) = \frac {1}{| \mathcal {D} _ {\mathrm {v a l}} |} \sum_ {\xi \in \mathcal {D} _ {\mathrm {v a l}}} \mathcal {L} (w ^ {*}; \xi) \\ \text {s . t .} w ^ {*} = \underset {w} {\arg \min } \underbrace {\frac {1}{| \mathcal {D} _ {\mathrm {t r}} |} \sum_ {\xi \in \mathcal {D} _ {\mathrm {t r}}} \left(\mathcal {L} (w , \lambda ; \xi) + \mathcal {R} _ {w , \lambda}\right)} _ {\mathcal {L} _ {\mathcal {D} _ {\mathrm {t r}}} (w, \lambda)}, \tag {11} \\ \end{array} +$$ + +where $\mathcal{D}_{\mathrm{val}}$ and $\mathcal{D}_{\mathrm{tr}}$ are validation and training data, $\mathcal{L}$ is the loss, and $\mathcal{R}_{w,\lambda}$ is a regularizer. In practice, the lower-level function $\mathcal{L}_{\mathcal{D}_{\mathrm{tr}}}(w,\lambda)$ is often strongly-convex w.r.t. $w$ . For example, for the data hyper-cleaning application proposed by Franceschi et al. 2018; Shaban et al. 2019, the predictor is modeled by a linear classifier, and the loss function $\mathcal{L}(w;\xi)$ is convex w.r.t. $w$ and $\mathcal{R}_{w,\lambda}$ is a strongly-convex regularizer, e.g., $L^2$ regularization. The sample sizes of $\mathcal{D}_{\mathrm{val}}$ and $\mathcal{D}_{\mathrm{tr}}$ are often large, and stochastic algorithms are pre + +ferred for achieving better efficiency. As a result, the above hyperparameter optimization falls into the stochastic bilevel optimization we study in eq. (2), and we can apply the proposed stocBiO here. Furthermore, Theorem 3 establishes its performance guarantee. + +# 6.1. Experiments + +We compare our proposed stocBiO with the following baseline bilevel optimization algorithms. + +- BSA (Ghadimi & Wang, 2018): implicit gradient based stochastic bilevel optimizer via single-sample sampling. +- TTSA (Hong et al., 2020): two-time-scale stochastic optimizer via single-sample data sampling. +- HOAG (Pedregosa, 2016): a hyperparameter optimization algorithm with approximate gradient. We use the implementation in the repository https://github.com/fabianp/hoag. +- reverse (Franceschi et al., 2017): an iterative differentiation based method that approximates the hypergradient via backpropagation. We use its implementation in https://github.com/prolearner/hypertorch. +- AID-FP (Grazzi et al., 2020): AID with the fixed-point method. We use its implementation in https://github.com/prolearner/hypertorch +- AID-CG (Grazzi et al., 2020): AID with the conjugate gradient method. We use its implementation in https://github.com/prolearner/hypertorch. + +We demonstrate the effectiveness of the proposed stocBiO algorithm on two experiments: data hyper-cleaning and + +![](images/75bba4109665ac7249166dbc1a892b568f00605ff0dcf1e84310df3e69b0b11e.jpg) +(a) Test loss and test accuracy v.s. running time + +![](images/86d7d50b04a74a7045a0c315e3ecf416090af2e7dc64c4fcd064575c0f55aab0.jpg) + +![](images/9de2c35119a003aa2f299a71c15cf81838eb182b07da0f63f53bd5f15f96ed63.jpg) +(b) Convergence rate with different batch sizes + +![](images/83205960be101d727ab14f964ecae498b87149b1e915e6e497c9b265b69ca5b7.jpg) + +![](images/a737c1956e14b42c7f5a7af445320dbae8214cb2cbf0b3627d4996649da92630.jpg) +Figure 4. Comparison of various stochastic bilevel algorithms on logistic regression on 20 Newsgroup dataset. + +![](images/94dc862b1d51949d8f4d7f4043bc5b74899d0413f236fe66f0696e6d545f8eeb.jpg) +(a) Corruption rate $p = 0.1$ + +![](images/2c1f0ed6e5aac12821bbd07961744a3710f1aae079aaa5dc275c5902f6090064.jpg) +(b) Corruption rate $p = 0.4$ + +![](images/9b41894ae87de2385d9f46425c15932bd2baa634f4bd53ded7e65afe55faa3a1.jpg) + +logistic regression. Due to the space limitations, we provide the details of the objective functions and hyperparameter settings in Appendix B. + +Logistic Regression on 20 Newsgroup: As shown in Figure 4(a), the proposed stocBiO achieves the fastest convergence rate as well as the best test accuracy among all comparison algorithms. This demonstrates the practical advantage of our proposed algorithm stocBiO. Note that we do not include BSA and TTSA in the comparison, because they converge too slowly with a large variance, and are much worse than the other competing algorithms. In addition, we investigate the impact of the batch size on the performance of our stocBiO in Figure 4(b). It can be seen that stocBiO outperforms HOAG under the batch sizes of 100, 500, 1000, 2000. This shows that the performance of stocBiO is not very sensitive to the batch size, and hence the tuning of the batch size is easy to handle in practice. + +Data Hyper-Cleaning on MNIST. It can be seen from Figures 5 and 6 that our proposed stocBiO algorithm achieves the fastest convergence rate among all competing algorithms in terms of both the training loss and the test loss. It is also observed that such an improvement is more significant when the corruption rate $p$ is smaller. We note that the stochastic algorithm TTSA converges very slowly with a large variance. This is because TTSA updates the costly outer loop more frequently than other algorithms, and has a larger variance due to the single-sample data sampling. As a comparison, our stocBiO has a much smaller variance for hypergradient estimation as well as a much faster convergence rate. This validates our theoretical results in Theorem 3. + +![](images/5d1089b20b47405eb60826b0902db0df42bc25e3294fd0dbb15b6e236f358478.jpg) +Figure 5. Comparison of various stochastic bilevel algorithms on hyperparameter optimization at different corruption rates. For each corruption rate $p$ , left plot: training loss v.s. running time; right plot: test loss v.s. running time. + +![](images/de888afc4b6ed28ee631b68a4e9c58682568ad55d80a49d410a41d36e22bd0f8.jpg) +Figure 6. Convergence of algorithms at corruption rate $p = 0.2$ . + +# 7. Conclusion + +In this paper, we develop a general and enhanced convergence rate analysis for the nonconvex-strongly-convex bilevel deterministic optimization, and propose a novel algorithm for the stochastic setting and show that its computational complexity outperforms the best known results orderly. Our results also provide the theoretical guarantee for various bilevel optimizers in meta-learning and hyperparameter optimization. Our experiments validate our theoretical results and demonstrate the superior performance of the proposed algorithm. We anticipate that the convergence rate analysis that we develop will be useful for analyzing other bilevel optimization problems with different loss geometries, and the proposed algorithms will be useful for other applications such as reinforcement learning and Stackelberg game. + +# Acknowledgements + +The work was supported in part by the U.S. National Science Foundation under the grants CCF-1909291 and CCF-1900145. + +# References + +Arnold, S. M., Mahajan, P., Datta, D., and Bunner, I. learn2learn, 2019. https://github.com/learnables/learn2learn. +Bertinetto, L., Henriques, J. F., Torr, P., and Vedaldi, A. Meta-learning with differentiable closed-form solvers. In International Conference on Learning Representations (ICLR), 2018. +Bracken, J. and McGill, J. T. Mathematical programs with optimization problems in the constraints. Operations Research, 21(1):37-44, 1973. +Domke, J. Generic methods for optimization-based modeling. In Artificial Intelligence and Statistics (AISTATS), pp. 318-326, 2012. +Feurer, M. and Hutter, F. Hyperparameter optimization. In *Automated Machine Learning*, pp. 3-33. Springer, Cham, 2019. +Finn, C., Abbeel, P., and Levine, S. Model-agnostic meta-learning for fast adaptation of deep networks. In Proc. International Conference on Machine Learning (ICML), pp. 1126-1135, 2017. +Flamary, R., Rakotomamonjy, A., and Gasso, G. Learning constrained task similarities in graphregularized multitask learning. Regularization, Optimization, Kernels, and Support Vector Machines, pp. 103, 2014. +Franceschi, L., Donini, M., Frasconi, P., and Pontil, M. Forward and reverse gradient-based hyperparameter optimization. In International Conference on Machine Learning (ICML), pp. 1165-1173, 2017. +Franceschi, L., Frasconi, P., Salzo, S., Grazzi, R., and Pontil, M. Bilevel programming for hyperparameter optimization and meta-learning. In International Conference on Machine Learning (ICML), pp. 1568-1577, 2018. +Ghadimi, S. and Wang, M. Approximation methods for bilevel programming. arXiv preprint arXiv:1802.02246, 2018. +Gould, S., Fernando, B., Cherian, A., Anderson, P., Cruz, R. S., and Guo, E. On differentiating parameterized argmin and argmax problems with application to bi-level optimization. arXiv preprint arXiv:1607.05447, 2016. +Grazzi, R., Franceschi, L., Pontil, M., and Salzo, S. On the iteration complexity of hypergradient computation. In Proc. International Conference on Machine Learning (ICML), 2020. + +Hansen, P., Jaumard, B., and Savard, G. New branch-and-bound rules for linear bilevel programming. SIAM Journal on Scientific and Statistical Computing, 13(5):1194-1217, 1992. +Hong, M., Wai, H.-T., Wang, Z., and Yang, Z. A two-timescale framework for bilevel optimization: Complexity analysis and application to actor-critic. arXiv preprint arXiv:2007.05170, 2020. +Ji, K. and Liang, Y. Lower bounds and accelerated algorithms for bilevel optimization. arXiv preprint arXiv:2102.03926, 2021. +Ji, K., Lee, J. D., Liang, Y., and Poor, H. V. Convergence of meta-learning with task-specific adaptation over partial parameters. In Advances in Neural Information Processing Systems (NeurIPS), 2020a. +Ji, K., Yang, J., and Liang, Y. Multi-step model-agnostic meta-learning: Convergence and improved algorithms. arXiv preprint arXiv:2002.07836, 2020b. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2014. +Konda, V. R. and Tsitsiklis, J. N. Actor-critic algorithms. In Advances in neural information processing systems (NeurIPS), pp. 1008-1014, 2000. +Krizhevsky, A. and Hinton, G. Learning multiple layers of features from tiny images. 2009. +Kunapuli, G., Bennett, K. P., Hu, J., and Pang, J.-S. Classification model selection via bilevel programming. Optimization Methods & Software, 23(4):475-489, 2008. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +Li, J., Gu, B., and Huang, H. Improved bilevel model: Fast and optimal algorithm with theoretical guarantee. arXiv preprint arXiv:2009.00690, 2020. +Liao, R., Xiong, Y., Fetaya, E., Zhang, L., Yoon, K., Pitkow, X., Urtasun, R., and Zemel, R. Reviving and improving recurrent back-propagation. In Proc. International Conference on Machine Learning (ICML), 2018. +Liu, R., Mu, P., Yuan, X., Zeng, S., and Zhang, J. A generic first-order algorithmic framework for bi-level programming beyond lower-level singleton. In International Conference on Machine Learning (ICML), 2020. +Lorraine, J., Vicol, P., and Duvenaud, D. Optimizing millions of hyperparameters by implicit differentiation. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1540-1552. PMLR, 2020. + +Maclaurin, D., Duvenaud, D., and Adams, R. Gradient-based hyperparameter optimization through reversible learning. In International Conference on Machine Learning (ICML), pp. 2113-2122, 2015. +Moore, G. M. Bilevel programming algorithms for machine learning model selection. Rensselaer Polytechnic Institute, 2010. +Okuno, T., Takeda, A., and Kawana, A. Hyperparameter learning via bilevel nonsmooth optimization. arXiv preprint arXiv:1806.01520, 2018. +Oreshkin, B., López, P. R., and Lacoste, A. Tadam: Task dependent adaptive metric for improved few-shot learning. In Advances in Neural Information Processing Systems (NeurIPS), pp. 721-731, 2018. +Pedregosa, F. Hyperparameter optimization with approximate gradient. In International Conference on Machine Learning (ICML), pp. 737-746, 2016. +Raghu, A., Raghu, M., Bengio, S., and Vinyals, O. Rapid learning or feature reuse? towards understanding the effectiveness of MAML. International Conference on Learning Representations (ICLR), 2019. +Rajeswaran, A., Finn, C., Kakade, S. M., and Levine, S. Meta-learning with implicit gradients. In Advances in Neural Information Processing Systems (NeurIPS), pp. 113-124, 2019. +Roth, A., Ullman, J., and Wu, Z. S. Watch and learn: Optimizing from revealed preferences feedback. In Annual ACM Symposium on Theory of Computing (STOC), pp. 949-962, 2016. +Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., Berg, A. C., and Fei-Fei, L. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 3(115):211-252, 2015. +Shaban, A., Cheng, C.-A., Hatch, N., and Boots, B. Truncated back-propagation for bilevel optimization. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1723-1732, 2019. +Shi, C., Lu, J., and Zhang, G. An extended kuhn-tucker approach for linear bilevel programming. Applied Mathematics and Computation, 162(1):51-63, 2005. +Snell, J., Swersky, K., and Zemel, R. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems (NIPS), 2017. +Vinyals, O., Blundell, C., Lillicrap, T., and Wierstra, D. Matching networks for one shot learning. In Advances in Neural Information Processing Systems (NIPS), 2016. + +Yu, T. and Zhu, H. Hyper-parameter optimization: A review of algorithms and applications. arXiv preprint arXiv:2003.05689, 2020. +Zügner, D. and Gunnemann, S. Adversarial attacks on graph neural networks via meta learning. In International Conference on Learning Representations (ICLR), 2019. \ No newline at end of file diff --git a/bileveloptimizationconvergenceanalysisandenhanceddesign/images.zip b/bileveloptimizationconvergenceanalysisandenhanceddesign/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3813d5d60825514d147f78c011424dad55ae8d68 --- /dev/null +++ b/bileveloptimizationconvergenceanalysisandenhanceddesign/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c712989e2ffa990643831815d8d977b4b63569f814404c8aeba6e349d35322f4 +size 488458 diff --git a/bileveloptimizationconvergenceanalysisandenhanceddesign/layout.json b/bileveloptimizationconvergenceanalysisandenhanceddesign/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..666ddf2ee0906e2bb471d016b161349196b9f738 --- /dev/null +++ b/bileveloptimizationconvergenceanalysisandenhanceddesign/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec3eaa22077050d6882b9b695bc4a861afdbff6479013911e8462690f65d7137 +size 702581 diff --git a/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_content_list.json b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ebe8e38f30e30b4b7c8d3d4caeace8aac454ed45 --- /dev/null +++ b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2273afa94510344d94c07fff8e109c70bf2eefa360b4d401417e11920dfae886 +size 103709 diff --git a/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_model.json b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8e49c698b59ae000ce88c47fab8d3092aa4a89ae --- /dev/null +++ b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73828e07c0d918ba18107c5069c8d28f5f34fe8cf07643d7c2479df30c93dbb6 +size 123037 diff --git a/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_origin.pdf b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..780d5e91ed9eb6dc5abb2c3649183fd58abde076 --- /dev/null +++ b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/018007d9-62b6-4afa-a9c1-fd2f671cc5ce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebed79d831a91a857ee01b981b1d371c53b771fcbd8a95bbbef65ee4d2228d1f +size 381936 diff --git a/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/full.md b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e2216554622057c20529c3f46971ea194cd172ce --- /dev/null +++ b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/full.md @@ -0,0 +1,524 @@ +# Bilinear Classes: A Structural Framework for Provable Generalization in RL + +Simon S. Du1 Sham M. Kakade1 Jason D. Lee2 Shachar Lovett3 Gaurav Mahajan3 Wen Sun4 Ruosong Wang5 + +# Abstract + +This work introduces Bilinear Classes, a new structural framework, which permits generalization in reinforcement learning in a wide variety of settings through the use of function approximation. The framework incorporates nearly all existing models in which a polynomial sample complexity is achievable, and, notably, also includes new models, such as the Linear $Q^{*} / V^{*}$ model in which both the optimal $Q$ -function and the optimal $V$ -function are linear in some known feature space. Our main result provides an RL algorithm which has polynomial sample complexity for Bilinear Classes; notably, this sample complexity is stated in terms of a reduction to the generalization error of an underlying supervised learning sub-problem. These bounds nearly match the best known sample complexity bounds for existing models. Furthermore, this framework also extends to the infinite dimensional (RKHS) setting: for the Linear $Q^{*} / V^{*}$ model, linear MDPs, and linear mixture MDPs, we provide sample complexities that have no explicit dependence on the explicit feature dimension (which could be infinite), but instead depends only on information theoretic quantities. + +# 1. Introduction + +Tackling large state-action spaces is a central challenge in reinforcement learning (RL). Here, function approximation and supervised learning schemes are often employed for generalization across large state-action spaces. While there have been a number of successful applications (Mnih et al., 2013; Kober et al., 2013; Silver et al., 2017; Wu et al., 2017). + +1University of Washington 2Princeton University 3University of California, San Diego 4Cornell University 5Carnegie Mellon University. Correspondence to: Gaurav Mahajan . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +there is also a realization that practical RL approaches are quite sample inefficient. + +Theoretically, there is a growing body of results showing how sample efficiency is possible in RL for particular model classes (often with restrictions on the model dynamics though in some cases on the class of value functions), e.g. State Aggregation (Li, 2009; Dong et al., 2020), Linear MDPs (Yang and Wang, 2019; Jin et al., 2020), Linear Mixture MDPs (Modi et al., 2020a; Ayoub et al., 2020), Reactive POMDPs (Krishnamurthy et al., 2016), Block MDPs (Du et al., 2019a), FLAMBE (Agarwal et al., 2020b), Reactive PSRs (Littman et al., 2001), Linear Bellman Complete (Munos, 2005; Zanette et al., 2020). + +More generally, there are also a few lines of work which propose more general frameworks, consisting of structural conditions which permit sample efficient RL; these include the low-rankness structure (e.g. the Bellman rank (Jiang et al., 2017) and Witness rank (Sun et al., 2019)) or under a complete condition (Munos, 2005; Zanette et al., 2020). The goal in these latter works is to develop a unified theory of generalization in RL, analogous to more classical notions of statistical complexity (e.g. VC-theory and Rademacher complexity) relevant for supervised learning. These latter frameworks are not contained in each other (see Table 1), and, furthermore, there are a number of natural RL models that cannot be incorporated into each of these frameworks (see Table 2). + +Motivated by this latter line of work, we aim to understand if there are simple and natural structural conditions which capture the learnability in a general class of RL models. + +Our Contributions. This work1 provides a simple structural condition on the hypothesis class (which may be either model-based or value-based), where the Bellman error has a particular bilinear form, under which sample efficient learning is possible; we refer such a framework as a Bilinear Class. This structural assumption can be seen as generalizing the Bellman rank (Jiang et al., 2017); furthermore, it not only contains existing frameworks, it also covers a number + +
FrameworkB-RankB-CompleteW-RankBilinear Class (this work)
B-Rank✓✗✓✓
B-Complete✗✓✗✓
W-Rank✗✗✓✓
Bilinear Class (this work)✗✗✗✓
+ +Table 1. Relations between frameworks. $\checkmark$ : the column framework contains the row framework. $\times$ : the column framework does not contain the row framework. B-Rank: Bellman Rank (Jiang et al., 2017), which is defined in terms of the roll-in distribution and the function approximation class for $Q^{*}$ . B-Complete: Bellman Complete (Munos, 2005) (Zanette et al. (2020) proposed a sample efficient algorithm), which assumes the function class is closed under the Bellman operator. W-Rank: Witness Rank (Sun et al., 2019): a model-based analogue of Bellman Rank. Bilinear Class: our proposed framework. + +
B-RankB-CompleteW-RankBilinear Class (this work)
Tabular MDP✓✓✓✓
Reactive POMDP (Krishnamurthy et al., 2016)✓✗✓✓
Block MDP (Du et al., 2019a)✓✗✓✓
Flambe / Feature Selection (Agarwal et al., 2020b)✓✗✓✓
Reactive PSR (Littman and Sutton, 2002)✓✗✓✓
Linear Bellman Complete (Munos, 2005)✗✓✗✓
Linear MDPs (Yang and Wang, 2019; Jin et al., 2020)✓!✓✓!✓
Linear Mixture Model (Modi et al., 2020b)✗✗✗✓
Linear Quadratic Regulator✗✓✗✓
Kernelized Nonlinear Regulator (Kakade et al., 2020)✗✗✓✓
Factored MDP (Kearns and Koller, 1999)✗✗✗✓
Q* “irrelevant” State Aggregation (Li, 2009)✓✗✗✓
Linear Q*/V* (this work)✗✗✗✓
RKHS Linear MDP (this work)✗✗✗✓
RKHS Linear Mixture MDP (this work)✗✗✗✓
Low Occupancy Complexity (this work)✗✗✗✓
Q* State-action Aggregation (Dong et al., 2020)✗✗✗✗
Deterministic linear Q* (Wen and Van Roy, 2013)✗✗✗✗
Linear Q* (Weisz et al., 2020)Sample efficiency is not possible
+ +Table 2. Whether a framework includes a model that permits a sample efficient algorithm. $\checkmark$ means the framework includes the model, $X$ means not, and $\checkmark!$ means the sample complexity using that framework needs to scale with the number of action (which is not necessary). "Sample efficient is not possible" means the sample complexity needs to scale exponentially with at least one problem parameter. See Section 3.3, Appendix A and full version of the paper (link) for detailed descriptions of the models. + +of new settings that are not easily incorporated in previous frameworks (see Tables 1 and 2). + +Our main result presents an optimization-based algorithm, BiLin-UCB, which provably enjoys a polynomial sample complexity guarantee for Bilinear Classes (cf. Theorem 4.2). Although our framework is more general than existing ones, our proof is substantially simpler – we give a unified analysis based on the elliptical potential lemma, developed for the theory of linear bandits (Dani et al., 2008; Srinivas et al., 2009). + +Furthermore, as a point of emphasis, our results are non-parametric in nature (stated in terms of an information gain quantity (Srinivas et al., 2009)), as opposed to finite dimensional as in prior work. From a technical point of view, it is not evident how to extend prior approaches to this non-parametric setting. Notably, the non-parametric regime is particularly relevant to RL due to that, in RL, performance bounds do not degrade gracefully with approximation error or model mis-specification (e.g. see Du et al. (2020a) for dis + +cussion of these issues); the relevance of the non-parametric regime is that it may provide additional flexibility to avoid the catastrophic quality degradation due to approximation error or model mis-specification. + +A few further notable contributions are: + +- Definition of Bilinear Class: Our key conceptual contribution is the definition of the Bilinear Class, which isolates two key critical properties. The first property is that the Bellman error can be upper bounded by a bilinear form depending on the hypothesis. The second property is that the corresponding bilinear form for all hypothesis in the hypothesis class can be estimated with the same dataset. Analogous to supervised learning, this allows for efficient data reuse to estimate the Bellman error for all hypothesis simultaneously and eliminate those with high error. +- A reduction to supervised learning: One appealing aspect of this framework is that the our main sample + +complexity result for RL is quantified via a reduction to the generalization error of a supervised learning problem, where we have a far better understanding of the latter. This is particularly important due to that we make no explicit assumptions on the hypothesis class $\mathcal{H}$ itself, thus allowing for neural hypothesis classes in some cases (the Bilinear Class posits an implicit relationship between $\mathcal{H}$ and the underlying MDP $\mathcal{M}$ ). + +- New models: We show our Bilinear Class framework incorporates new natural models, that are not easily incorporated into existing frameworks, e.g. linear $Q^{*} / V^{*}$ , Low Occupancy Complexity, along with (infinite-dimensional) RKHS versions of linear MDPs and linear mixture MDPs. The linear $Q^{*} / V^{*}$ result is particularly notable due to a recent and remarkable lower bound which showed that if we only assume $Q^{*}$ is linear in some given set of features, then sample efficient learning is information theoretically not possible (Weisz et al., 2020). In perhaps a surprising contrast, our works show that if we assume that both $Q^{\star}$ and $V^{\star}$ are linear in some given features then sample efficient learning is in fact possible. + +- Non-parametric rates: Our work is applicable to the non-parametric setting, where we develop new analysis tools to handle a number of technical challenges. This is notable as non-parametric rates for RL are few and far between. Our results are stated in terms of the critical information gain which can be viewed as an analogous quantity to the critical radius, a quantity which is used to obtain sharp rates in non-parametric statistical settings (Wainwright, 2019). + +Organization Section 2 introduces some technical background and notation. Section 3 introduces our Bilinear Class framework, where we instantiate it on the several RL models, and Section 4 describes our algorithm and provides our main theoretical results. + +# 2. Setting + +We denote an episodic finite horizon, non-stationary MDP with horizon $H$ , by $\mathcal{M} = \{\mathcal{S}, \mathcal{A}, r, H, \{P_h\}_{h=0}^{H-1}, s_0\}$ , where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space, $r: \mathcal{S} \times \mathcal{A} \mapsto [0,1]$ is the expected reward function with the corresponding random variable $R(s, a)$ , $P_h: \mathcal{S} \times \mathcal{A} \mapsto \triangle(\mathcal{S})$ (where $\triangle(\mathcal{S})$ denotes the probability simplex over $\mathcal{S}$ ) is the transition kernel for all $h$ , $H \in \mathbb{Z}_+$ is the planning horizon and $s_0$ is a fixed initial state. For ease of exposition, we use the notation $o_h$ for "observed transition info at timestep $h$ " i.e. $o_h = (r_h, s_h, a_h, s_{h+1})$ where $r_h$ is the observed reward $r_h = R(s_h, a_h)$ and $s_h, a_h, s_{h+1}$ is the observed + +state transition at timestep $h$ . + +A deterministic, stationary policy $\pi : S \mapsto \mathcal{A}$ specifies a decision-making strategy in which the agent chooses actions adaptively based on the current state, i.e. $a_h \sim \pi(s_h)$ . We denote a non-stationary policy $\pi = \{\pi_0, \dots, \pi_{H-1}\}$ as a sequence of stationary policies where $\pi_h : S \mapsto \mathcal{A}$ . + +Given a policy $\pi$ and a state-action pair $(s,a)\in S\times \mathcal{A}$ , the $Q$ -function at time step $h$ is defined as + +$$ +Q _ {h} ^ {\pi} (s, a) = \mathbb {E} \left[ \sum_ {h ^ {\prime} = h} ^ {H - 1} R \left(s _ {h ^ {\prime}}, a _ {h ^ {\prime}}\right) \mid s _ {h} = s, a _ {h} = a, \pi \right], +$$ + +and, similarly, a value function time step $h$ of a given state $s$ under a policy $\pi$ is defined as + +$$ +V _ {h} ^ {\pi} (s) = \mathbb {E} \left[ \sum_ {h ^ {\prime} = h} ^ {H - 1} R \left(s _ {h ^ {\prime}}, a _ {h ^ {\prime}}\right) \mid s _ {h} = s, \pi \right], +$$ + +where both expectations are with respect to $s_0, a_0, \ldots, s_{H-1}, a_{H-1} \sim d^\pi$ . We use $Q_h^\star$ and $V_h^\star$ to denote the $Q$ and $V$ -functions of the optimal policy. + +Sample Efficient Algorithms. Throughout the paper, we will consider an algorithm as sample-efficient, if it uses number of trajectories polynomial in the problem horizon $H$ , inherent dimension $d$ , accuracy parameter $1 / \epsilon$ and polylogarithmic in the number of candidate value-functions. + +Notation. For any two vectors $x, y$ , we denote $[x, y]$ as the vector that concatenates $x, y$ , i.e., $[x, y] := [x^{\top}, y^{\top}]^{\top}$ . For any set $S$ , we write $\triangle(S)$ to denote the probability simplex. We often use $U(S)$ as the uniform distribution over set $S$ . We will let $\mathcal{V}$ denote a Hilbert space (which we assume is either finite dimensional or separable). + +We let $[H]$ denote the set $\{0, \ldots, H - 1\}$ . We slightly abuse notation (overloading $d^{\pi}$ with its marginal distributions), where $s_h \sim d^{\pi}$ , $(s_h, a_h) \sim d^{\pi}$ , $(r_h, s_h, a_h, s_{h+1}) \sim d^{\pi}$ and most frequently $o_h \sim d^{\pi}$ denotes the marginal distributions at timestep $h$ . We also use the shorthand notation $s_0, a_0, \ldots, s_{H-1}, a_{H-1} \sim \pi$ , $s_h, a_h \sim \pi$ for $s_0, a_0, \ldots, s_{H-1}, a_{H-1} \sim d^{\pi}$ , $s_h, a_h \sim d^{\pi}$ . + +# 3. Bilinear Classes + +Before, we define our structural framework - Bilinear Class, we first define our hypothesis class. + +Hypothesis Classes. We assume access to a hypothesis class $\mathcal{H} = \mathcal{H}_0\times \ldots \times \mathcal{H}_{H - 1}$ , which can be abstract sets that permit for both model-based and value-based hypotheses. The only restriction we make is that for all $f\in \mathcal{H}$ , we have an associated state-action value function $Q_{h,f}$ and a value + +function $V_{h,f}$ . Furthermore, we assume the hypothesis class is constrained so that $V_{h,f}(s) = \max_a Q_{h,f}(s,a)$ for all $f\in \mathcal{H}$ , $h\in [H]$ , and $s\in S$ , which is always possible as we can remove hypothesis for which this is not true. We let $\pi_{h,f}$ be the greedy policy with respect to $Q_{h,f}$ , i.e., $\pi_{h,f}(s) = \operatorname{argmax}_{a\in A} Q_{h,f}(s,a)$ , and $\pi_f$ as the sequence of time-dependent policies $\{\pi_{h,f}\}_{h=0}^{H-1}$ . + +# 3.1. Warmup: Bellman rank, the $Q$ and $V$ versions. + +As a motivation for our structural framework, we next discuss Bellman rank framework considered in (Jiang et al., 2017). In this case, the hypothesis class $\mathcal{H}_h$ contains Q value functions, i.e., + +$$ +\mathcal {H} _ {h} \subset \left\{Q _ {h} \mid Q _ {h} \text {i s a f u n c t i o n f r o m} S \times \mathcal {A} \mapsto [ 0, H ] \right\}. +$$ + +In this case, for any hypothesis $f \coloneqq (Q_0, Q_1, \ldots, Q_{H-1}) \in \mathcal{H}$ , we take the associated state-action value function $Q_{h,f} = Q_h$ and the associated state value $V_{h,f}$ function to be greedy with respect to the $Q_{h,f}$ function i.e. $V_{h,f}(\cdot) = \max_{a \in \mathcal{A}} Q_{h,f}(\cdot, a)$ . + +Definition 3.1 (V-Bellman Rank). A MDP has a V-Bellman rank of dimension $d$ if for all $h \in [H]$ , there exist functions $W_{h} : \mathcal{H} \to \mathbb{R}^{d}$ and $X_{h} : \mathcal{H} \to \mathbb{R}^{d}$ , such that for all $f, g \in \mathcal{H}$ : + +$$ +\begin{array}{l} \mathbb {E} \left[ V _ {h, g} \left(s _ {h}\right) - r \left(s _ {h}, a _ {h}\right) - V _ {h + 1, g} \left(s _ {h + 1}\right) \right] \\ = \left\langle W _ {h} (g) - W _ {h} \left(f ^ {\star}\right), X _ {h} (f) \right\rangle . \\ \end{array} +$$ + +where $a_{0:h - 1}\sim d^{\pi_f}$ $a_{h} = \pi_{g}(s_{h})$ and $s_{h + 1}\sim P(s_h,a_h)$ + +Even though (Jiang et al., 2017) only considered $V$ -Bellman Rank, as a natural extension of this definition, we can also consider the $Q$ -Bellman Rank. + +Definition 3.2 (Q-Bellman Rank). For a given MDP $\mathcal{M}$ we say that our state-action value hypothesis class $\mathcal{H}$ has a Q-Bellman rank of dimension $d$ if for all $h\in [H]$ , there exist functions $W_{h}:\mathcal{H}\to \mathbb{R}^{d}$ and $X_{h}:\mathcal{H}\rightarrow \mathbb{R}^{d}$ , such that for all $f,g\in \mathcal{H}$ + +$$ +\begin{array}{l} \mathbb {E} \left[ Q _ {h, g} \left(s _ {h}, a _ {h}\right) - r \left(s _ {h}, a _ {h}\right) - V _ {h + 1, g} \left(s _ {h + 1}\right) \right] \\ = \left\langle W _ {h} (g) - W _ {h} \left(f ^ {\star}\right), X _ {h} (f) \right\rangle . \\ \end{array} +$$ + +where $a_{0:h}\sim d^{\pi_f}$ and $s_{h + 1}\sim P(s_h,a_h)$ + +Let us interpret how the two definitions differ in the usage of functions $V_{h,f}$ vs $Q_{h,f}$ (along with the usage of the "estimation" policies $a_{0:h} \sim \pi_f$ vs $a_{0:h-1} \sim \pi_f$ and $a_h \sim \pi_g$ ). Recall that the Bellman equations can be written in terms of the value functions or the state-action values; here, the intuition is that the former definition corresponds to enforcing Bellman consistency of the value functions while the + +latter definition corresponds to enforcing Bellman consistency of the state-action value functions. Our more general structural framework, Bilinear Classes, will cover both these definitions for infinite dimensional hypothesis class (note that (Jiang et al., 2017) only considered finite dimensional hypothesis class). + +# 3.2. Bilinear Classes + +We now introduce a new structural framework – the Bilinear Class. + +Realizability. We say that $\mathcal{H}$ is realizable for an MDP $\mathcal{M}$ if, for all $h\in [H]$ , there exists a hypothesis $f^{\star}\in \mathcal{H}$ such that $Q_{h}^{\star}(s,a) = Q_{h,f^{\star}}(s,a)$ , where $Q_{h}^{\star}$ is the optimal state-action value at time step $h$ in the ground truth MDP $\mathcal{M}$ . For instance, for the model-based perspective, the realizability assumption is implied if the ground truth transition $P$ belongs to our hypothesis class $\mathcal{H}$ . + +Now we are ready to introduce the Bilinear Class. + +Definition 3.3 (Bilinear Class). Consider an MDP $\mathcal{M}$ , a hypothesis class $\mathcal{H}$ , a discrepancy function $\ell_f: (\mathbb{R} \times \mathcal{S} \times \mathcal{A} \times \mathcal{S}) \times \mathcal{H} \to \mathbb{R}$ (defined for each $f \in \mathcal{H}$ ), and a set of estimation policies $\Pi_{\mathrm{est}} = \{\pi_{est}(f): f \in \mathcal{H}\}$ . We say $(\mathcal{H}, \ell_f, \Pi_{\mathrm{est}}, \mathcal{M})$ is (implicitly) a Bilinear Class if $\mathcal{H}$ is realizable in $\mathcal{M}$ and if there exist functions $W_h: \mathcal{H} \to \mathcal{V}$ and $X_h: \mathcal{H} \to \mathcal{V}$ for some Hilbert space $\mathcal{V}$ , such that the following two properties hold for all $f \in \mathcal{H}$ and $h \in [H]$ : + +1. We have: + +$$ +\begin{array}{l} \left| \mathbb {E} _ {a _ {0: h}} \sim_ {\pi_ {f}} \left[ Q _ {h, f} \left(s _ {h}, a _ {h}\right) - r \left(s _ {h}, a _ {h}\right) - V _ {h + 1, f} \left(s _ {h + 1}\right) \right] \right| \\ \leq \left| \left\langle W _ {h} (f) - W _ {h} \left(f ^ {\star}\right), X _ {h} (f) \right\rangle \right| \tag {1} \\ \end{array} +$$ + +2. The policy $\pi_{est}(f)$ and discrepancy measure $\ell_f(o_h, g)$ can be used for estimation in the following sense: for any $g \in \mathcal{H}$ , we have that (here $o_h = (r_h, s_h, a_h, s_{h+1})$ is the "observed transition info") + +$$ +\begin{array}{l} \left. \left| \mathbb {E} _ {a _ {0}; h - 1} \sim \pi_ {f} \mathbb {E} _ {a _ {h}} \sim \pi_ {e s t} (f) \left[ \ell_ {f} \left(o _ {h}, g\right) \right] \right| \right. \\ = \left| \left\langle W _ {h} (g) - W _ {h} \left(f ^ {\star}\right), X _ {h} (f) \right\rangle \right|. \tag {2} \\ \end{array} +$$ + +Typically, $\pi_{est}(f)$ will be either the uniform distribution on $\mathcal{A}$ or $\pi_f$ itself; in the latter case, we refer to the estimation strategy as being on-policy. + +We also define $\mathcal{X}_h\coloneqq \{X_h(f)\colon f\in \mathcal{H}\}$ and $\mathcal{X}\coloneqq \{\mathcal{X}_h$ $h\in [H]\}$ + +We emphasize the above definition only assumes the existence of $W$ and $X$ functions. Particularly, our algorithm only uses the discrepancy function $\ell_f$ , and does not need to know $W$ or $X$ . A typical example of discrepancy function $\ell_f(o_h,g)$ would be the bellman error + +$Q_{h,g}(s_h,a_h) - r_h - V_{h + 1,g}(s_{h + 1})$ , but we would often need to use a different discrepancy function see for e.g. Linear Mixture Models (Section 3.3.1). + +We now provide some intuition for definition of Bilinear Class. The first part of the definition (Equation (1)) basically relates the Bellman error for hypothesis $f$ (and hence sub-optimality) to the sum of bilinear forms $|\langle W_h(f) - W_h(f^\star), X_h(f) \rangle|$ (see for example proof of Lemma C.5). Crucially, the second part of the definition (Equation (2)), allows us to "reuse" data from hypothesis $f$ to estimate the bilinear form $|\langle W_h(g) - W_h(f^\star), X_h(f) \rangle|$ for all hypothesis $g$ in our hypothesis class! This is reminiscent of uniform convergence guarantees in supervised learning, where data can be reused to simultaneously estimate the loss for all hypothesis and eliminate those with high loss. + +# 3.2.1. FINITE BELLMAN RANK $\Rightarrow$ BILINEAR CLASS + +Here we show our framework naturally generalizes the Bellman rank framework (Section 3.1). For $Q$ -bellman rank case, we define the discrepancy function $\ell_f$ for observed transition info $o_h = (r_h, s_h, a_h, s_{h+1})$ as: + +$$ +\ell_ {f} \left(o _ {h}, g\right) = Q _ {h, g} \left(s _ {h}, a _ {h}\right) - r _ {h} - V _ {h + 1, g} \left(s _ {h + 1}\right). +$$ + +Lemma 3.1 (Finite $Q$ -Bellman Rank $\Rightarrow$ Bilinear Class). For given MDP $\mathcal{M}$ , suppose our hypothesis class $\mathcal{H}$ has a $Q$ -Bellman rank of dimension $d$ . Then, for on-policy estimation policies $\pi_{est} = \pi_f$ , and the discrepancy function $\ell_f$ defined above, $(\mathcal{H}, \ell_f, \Pi_{\mathrm{est}}, \mathcal{M})$ is (implicitly) a Bilinear Class. + +In the $V$ -Bellman rank setting, we define the discrepancy function $\ell_f(o_h,g)$ for observed transition info $o_h = (r_h,s_h,a_h,s_{h + 1})$ as: + +$$ +\frac {\mathbf {1} \left\{a _ {h} = \pi_ {g} \left(s _ {h}\right) \right\}}{1 / | \mathcal {A} |} \left(V _ {h, g} \left(s _ {h}\right) - r _ {h} - V _ {h + 1, g} \left(s _ {h + 1}\right)\right). +$$ + +Lemma 3.2 (Finite $V$ -Bellman Rank $\Rightarrow$ Bilinear Class). For given MDP $\mathcal{M}$ , suppose our hypothesis class $\mathcal{H}$ has a $V$ -Bellman rank of dimension $d$ . Then, for uniform estimation policies $\pi_{est} = U(\mathcal{A})$ , and the discrepancy function $\ell_f$ defined above, $(\mathcal{H}, \ell_f, \Pi_{\mathrm{est}}, \mathcal{M})$ is (implicitly) a Bilinear Class. + +# 3.3. Examples + +We now provide examples of Bilinear Classes: two known models (Linear Bellman Complete and Linear Mixture Models) and two new models that we propose (Linear $Q^{\star} / V^{\star}$ and Low Occupancy Complexity). We return to these examples to give non-parametric sample complexities in Section 4.2. + +# 3.3.1. LINEAR MIXTURE MDP. + +First, we show our definition naturally captures model-based hypothesis class. + +Definition 3.4 (Linear Mixture Model). We say that a MDP $\mathcal{M}$ is a Linear Mixture Model if there exists (known) features $\phi : S \times \mathcal{A} \times S \mapsto \mathcal{V}$ and $\psi : S \times \mathcal{A} \mapsto \mathcal{V}$ ; and (unknown) $\theta^{\star} \in \mathcal{V}$ for some Hilbert space $\mathcal{V}$ such that for all $h \in [H]$ and $(s, a, s') \in S \times \mathcal{A} \times S$ + +$$ +P _ {h} \left(s ^ {\prime} \mid s, a\right) = \left\langle \theta_ {h} ^ {\star}, \phi \left(s, a, s ^ {\prime}\right) \right\rangle \text {a n d} r (s, a) = \left\langle \theta_ {h} ^ {\star}, \psi (s, a) \right\rangle . +$$ + +We denote hypothesis in our hypothesis class $\mathcal{H}$ as tuples $(\theta_0,\ldots \theta_{H - 1})$ , where $\theta_h\in \mathcal{V}$ . Recall that given a model $f\in \mathcal{H}$ (i.e. $f$ is the time-dependent transitions, i.e., $f_{h}:\mathcal{S}\times$ $\mathcal{A}\mapsto \Delta (\mathcal{S}))$ , we denote $V_{h,f}$ as the optimal value function under model $f$ and corresponding reward function (in this case defined by $\psi$ ). Specifically, for any hypothesis $g =$ $\{\theta_0,\dots ,\theta_{H - 1}\} \in \mathcal{H},V_{h,g}$ and $Q_{h,g}$ satisfy the following Bellman optimality equation: + +$$ +Q _ {h, g} \left(s _ {h}, a _ {h}\right) = \theta_ {h} ^ {\top} \left(\psi \left(s _ {h}, a _ {h}\right) + \sum_ {\bar {s} \in \mathcal {S}} \phi \left(s _ {h}, a _ {h}, \bar {s}\right) V _ {h + 1, g} (\bar {s})\right) +$$ + +Note that in this example, discrepancy function will explicitly depend on $f$ . For hypothesis $g = \{\theta_0,\dots ,\theta_{H - 1}\} \in \mathcal{H}$ and observed transition info $o_h = (r_h,s_h,a_h,s_{h + 1})$ , we define + +$$ +\begin{array}{l} \ell_ {f} \left(o _ {h}, g\right) = \theta_ {h} ^ {\top} \left(\psi \left(s _ {h}, a _ {h}\right) + \sum_ {\bar {s} \in \mathcal {S}} \phi \left(s _ {h}, a _ {h}, \bar {s}\right) V _ {h + 1, f} (\bar {s})\right) \\ - \left(V _ {h + 1, f} (s _ {h + 1}) + r _ {h}\right). \\ \end{array} +$$ + +Lemma 3.3 (Linear Mixture Model $\Rightarrow$ Bilinear Class). Consider a MDP $\mathcal{M}$ which is a Linear Mixture Model. Then, for the hypothesis class $\mathcal{H}$ , discrepancy function $\ell_f$ defined above and on-policy estimation policies $\pi_{est}(f) = \pi_f$ , $(\mathcal{H},\ell_f,\Pi_{\mathrm{est}},\mathcal{M})$ is (implicitly) a Bilinear Class. + +# 3.3.2. LINEAR $Q^{\star} / V^{\star}$ (NEW MODEL) + +We introduce a new model: linear $Q^{\star} / V^{\star}$ where we assume both the optimal $Q^{\star}$ and $V^{\star}$ are linear functions in features that lie in (possibly infinite dimensional) Hilbert space. + +Definition 3.5 (Linear $Q^{\star} / V^{\star}$ ). We say that a MDP $\mathcal{M}$ is a linear $Q^{\star} / V^{\star}$ model if there exist (known) features $\phi : S \times \mathcal{A} \mapsto \mathcal{V}_1$ , $\psi : S \mapsto \mathcal{V}_2$ and (unknown) $(w^{\star}, \theta^{\star}) \in \mathcal{V}_1 \times \mathcal{V}_2$ for some Hilbert spaces $\mathcal{V}_1, \mathcal{V}_2$ such that for all $h \in [H]$ and for all $(s, a, s') \in S \times \mathcal{A} \times S$ , + +$$ +Q _ {h} ^ {\star} (s, a) = \left\langle w _ {h} ^ {\star}, \phi (s, a) \right\rangle \quad a n d \quad V _ {h} ^ {\star} \left(s ^ {\prime}\right) = \left\langle \theta_ {h} ^ {\star}, \psi \left(s ^ {\prime}\right) \right\rangle . +$$ + +Here, our hypothesis class $\mathcal{H} = \mathcal{H}_0 \times \ldots$ , $\mathcal{H}_{H-1}$ is a set of linear functions i.e. for all $h \in [H]$ , the set $\mathcal{H}_h$ is defined as: + +$$ +\left\{(w, \theta) \in \mathcal {V} _ {1} \times \mathcal {V} _ {2} \colon \max _ {a \in \mathcal {A}} w ^ {\top} \phi (s, a) = \theta^ {\top} \psi (s), \forall s \in \mathcal {S} \right\}. +$$ + +We define the following discrepancy function $\ell_f$ (in this case the discrepancy function does not depend on $f$ ), for hypothesis $g = \{(w_h, \theta_h)\}_{h=0}^{H-1}$ and observed transition info $o_h = (r_h, s_h, a_h, s_{h+1})$ : + +$$ +\begin{array}{l} \ell_ {f} \left(o _ {h}, g\right) = Q _ {h, g} \left(s _ {h}, a _ {h}\right) - r _ {h} - V _ {h + 1, g} \left(s _ {h + 1}\right) \\ = w _ {h} ^ {\top} \phi \left(s _ {h}, a _ {h}\right) - r _ {h} - \theta_ {h + 1} ^ {\top} \psi \left(s _ {h + 1}\right). \\ \end{array} +$$ + +Lemma 3.4 (Linear $Q^{\star} / V^{\star}\Rightarrow$ Bilinear Class). Consider a MDP $\mathcal{M}$ which is a linear $Q^{\star} / V^{\star}$ model. Then, for the hypothesis class $\mathcal{H}$ , the discrepancy function $\ell_f$ defined above and on-policy estimation policies $\pi_{est}(f) = \pi_f$ , $(\mathcal{H},\ell_f,\Pi_{est},\mathcal{M})$ is (implicitly) a Bilinear Class. + +# 3.3.3. BELLMAN COMPLETE AND LINEAR MDPS + +We now consider Bellman Complete which captures the linear MDP model (see the full paper for more detail on linear MDP model). Here, our hypothesis class $\mathcal{H}$ is set of linear functions with respect to some (known) feature $\phi : S \times \mathcal{A} \mapsto \mathcal{V}$ , where $\mathcal{V}$ is a Hilbert space. We denote hypothesis in our hypothesis class $\mathcal{H}$ as tuples $(\theta_0, \ldots, \theta_{H-1})$ where $\theta_h \in \mathcal{V}$ . + +Definition 3.6 (Linear Bellman Complete). We say our hypothesis class $\mathcal{H}$ is Linear Bellman Complete with respect to $\mathcal{M}$ if $\mathcal{H}$ is realizable and there exists $\mathcal{T}_h: \mathcal{V} \to \mathcal{V}$ such that for all $(\theta_0, \ldots, \theta_{H-1}) \in \mathcal{H}$ and $h \in [H]$ , + +$$ +\mathcal {T} _ {h} (\theta_ {h + 1}) ^ {\top} \phi (s, a) = r (s, a) + \mathbb {E} _ {s ^ {\prime} \sim P _ {h} (s, a)} \max _ {a ^ {\prime} \in \mathcal {A}} \theta_ {h + 1} ^ {\top} \phi (s ^ {\prime}, a ^ {\prime}). +$$ + +for all $(s,a)\in S\times \mathcal{A}$ + +We define the following discrepancy function $\ell_f$ (in this case the discrepancy function does not depend on $f$ ), for hypothesis $g = (\theta_0, \dots, \theta_{H-1})$ and observed transition info $o_h = (r_h, s_h, a_h, s_{h+1})$ : + +$$ +\begin{array}{l} \ell_ {f} \left(o _ {h}, g\right) = Q _ {h, g} \left(s _ {h}, a _ {h}\right) - r _ {h} - V _ {h + 1, g} \left(s _ {h + 1}\right) \\ = \theta_ {h} ^ {\top} \phi \left(s _ {h}, a _ {h}\right) - r _ {h} - \max _ {a ^ {\prime} \in \mathcal {A}} \theta_ {h + 1} ^ {\top} \phi \left(s _ {h + 1}, a ^ {\prime}\right). \\ \end{array} +$$ + +Lemma 3.5 (Linear Bellman Complete $\Rightarrow$ Bilinear Class). Consider an MDP $\mathcal{M}$ and hypothesis class $\mathcal{H}$ such that $\mathcal{H}$ is Linear Bellman Complete with respect to $\mathcal{M}$ . Then, for on-policy estimation policies $\pi_{est}(f) = \pi_f$ and the discrepancy function $\ell_f$ defined above, $(\mathcal{H},\ell_f,\Pi_{\mathrm{est}},\mathcal{M})$ is (implicitly) a Bilinear Class. + +3.3.4. LOW OCCUPANCY COMPLEXITY (NEW MODEL). + +We introduce another new model: Low Occupancy Complexity. + +Definition 3.7 (Low Occupancy Complexity). We say that a MDP $\mathcal{M}$ and hypothesis class $\mathcal{H}$ has low occupancy complexity with respect to a (possibly unknown) feature mapping $\phi_h: \mathcal{S} \times \mathcal{A} \to \mathcal{V}$ (where $\mathcal{V}$ is a Hilbert space) if $\mathcal{H}$ is realizable and there exists a (possibly unknown) $\beta_h: \mathcal{H} \mapsto \mathcal{V}$ for $h \in [H]$ such that for all $f \in \mathcal{H}$ and $(s_h, a_h) \in \mathcal{S} \times \mathcal{A}$ we have that: + +$$ +d ^ {\pi_ {f}} \left(s _ {h}, a _ {h}\right) = \left\langle \beta_ {h} (f), \phi_ {h} \left(s _ {h}, a _ {h}\right) \right\rangle . +$$ + +It is important to emphasize that for this hypothesis class, we are only assuming realizability, but it is otherwise arbitrary (e.g. it could be a neural state-action value class) and the algorithm does not need to know the features $\phi_h$ nor $\beta_h$ . It is straight forward to see that such a class is Bilinear Class with discrepancy function $\ell_f$ defined for hypothesis $g \in \mathcal{H}$ and observed transition info $o_h = (r_h, s_h, a_h, s_{h+1})$ as, + +$$ +\ell_ {f} \left(o _ {h}, g\right) = Q _ {h, g} \left(s _ {h}, a _ {h}\right) - r _ {h} - V _ {h + 1, g} \left(s _ {h + 1}\right) +$$ + +Lemma 3.6 (Low Occupancy Complexity $\Rightarrow$ Bilinear Class). Consider a MDP $\mathcal{M}$ and hypothesis class $\mathcal{H}$ which has low occupancy complexity. Then, for the discrepancy function $\ell_f$ defined above and on-policy estimation policies $\pi_{est}(f) = \pi_f$ , $(\mathcal{H},\ell_f,\Pi_{\mathrm{est}},\mathcal{M})$ is (implicitly) a Bilinear Class. + +Note that as such the hypothesis class $\mathcal{H}$ could be arbitrary and unlike other models where we assume linearity, here it could be a neural state-action value class. Our model can also capture the setting where the state-only occupancy has low complexity, i.e., $d^{\pi_f}(s_h) = \beta_h(f)\mu_h(s_h)$ , for some $\mu_h: S \to \mathcal{V}$ . In this case, we will use $\pi_{est} = U(\mathcal{A})$ . + +# 4. The Algorithm and Theory + +Our algorithm, BiLin-UCB, is described in Algorithm 1, which takes three parameters as inputs, the number of iterations $T$ , the trajectory batch size $m$ per iteration and a confidence radius $R$ . The key component of the algorithm is a constrained optimization in Line 1. For each time step $h$ , we use all previously collected data to form a single constraint using $\ell_f$ . The constraint refines the original version space $\mathcal{H}$ to be a restricted version space containing only hypothesis that are consistent with the current batch data. We then perform an optimistic optimization: we search for a feasible hypothesis $g$ that achieves the maximum total reward $V_g(s_0)$ . + +There are two ways to collect batch samples. For the case where $\pi_{est} = \pi_{f_t}$ , then for data collection in Line 1, we can + +# Algorithm 1 BiLin-UCB + +1: Input: number of iterations $T$ , estimator function $\ell$ , batch size $m$ , confidence radius $R$ +2: for iteration $t = 0,1,2,\ldots ,T - 1$ do +3: Set $f_{t}$ as the solution of the following program: + +$$ +\operatorname * {a r g m a x} _ {g \in \mathcal {H}} V _ {g} (s _ {0}) \text {s u b j e c t t o} +$$ + +$$ +\sum_ {i = 0} ^ {t - 1} \left(\mathcal {L} _ {\mathcal {D} _ {i; h}, f _ {i}} (g)\right) ^ {2} \leq R ^ {2} \quad \forall h \in [ H ] +$$ + +4: For all $h \in [H]$ , create batch datasets $\mathcal{D}_{t;h} = \{(r_h^i, s_h^i, a_h^i, s_{h+1}^i)\}_{i=0}^{m-1}$ sampled from distribution induced by $a_{0:h-1} \sim d^{\pi_{ft}}$ and $a_h \sim \pi_{est}$ . + +5: end for +6: return $\max_{t\in [T]}V^{\pi_{f_t}}$ + +generate $m$ length-H trajectories by executing $\pi_{f_t}$ starting from $s_0$ . For the general case (e.g. consider setting $\pi_{est}$ to be a uniform distribution over $\mathcal{A}$ ), we gather the data for each $h \in [H]$ independently. For $h \in [H]$ , we first roll-in with $\pi_{f_t}$ to generate $s_h$ ; then execute $a_h \sim \pi_{est}$ ; and then continue to generate $s_{h+1} \sim P_h(\cdot | s_h, a_h)$ and $r_h \sim R(\cdot | s_h, a_h)$ . Repeating this process for all $h$ , we need $Hm$ trajectories to form the batch datasets $\{\mathcal{D}_{t;h}\}_{h=0}^{H-1}$ . + +# 4.1. Main Theory: Generalization in Bilinear Classes + +We now present our main result. We first define some notations. We denote the expectation of the function $\ell_f(\cdot, g)$ under distribution $\mu$ over $\mathbb{R} \times \mathcal{S} \times \mathcal{A} \times \mathcal{S}$ by + +$$ +\mathcal {L} _ {\mu , f} (g) = \mathbb {E} _ {o \sim \mu} [ \ell_ {f} (o, g) ] +$$ + +For a set $\mathcal{D} \subset \mathcal{S} \times \mathcal{A} \times \mathcal{S}$ , we will also use $\mathcal{D}$ to represent the uniform distribution over this set. + +Assumption 4.1 (Ability to Generalize). We assume there exists functions $\varepsilon_{gen}(m,\mathcal{H})$ and $\operatorname{conf}(\delta)$ such that for any distribution $\mu$ over $\mathbb{R}\times \mathcal{S}\times \mathcal{A}\times \mathcal{S}$ and for any $\delta \in (0,1 / 2)$ , with probability of at least $1 - \delta$ over choice of an i.i.d. sample $\mathcal{D}\sim \mu^m$ of size $m$ , + +$$ +\sup _ {g \in \mathcal {H}} | \mathcal {L} _ {\mathcal {D}, f} (g) - \mathcal {L} _ {\mu , f} (g) | \leq \varepsilon_ {g e n} (m, \mathcal {H}) \cdot c o n f (\delta) +$$ + +Remark 4.1. It is helpful to separate the dependence of generalization error on failure probability $\delta$ and number of samples $m$ in order to state Theorem 4.2 concisely. $\varepsilon_{gen}(m,\mathcal{H})$ is related to uniform convergence and measures the generalization error of hypothesis class $\mathcal{H}$ and for the hypothesis classes discussed in this paper, $\varepsilon_{gen}(m,\mathcal{H})\to 0$ as $m\to \infty$ . One example is when $\pi_{est} = \pi_f$ , and $\mathcal{H}$ is a discrete function class, then we have $\varepsilon_{gen}(m,\mathcal{H}) = O\left(\sqrt{(1 + \ln(|\mathcal{H}|)) / m}.\right)$ . In Appendix $F$ , we also discuss + +uniform convergence via a novel covering argument for infinite dimensional RKHS. + +Recall the definitions $\mathcal{X}_h\coloneqq \{X_h(f)\colon f\in \mathcal{H}\}$ and $\mathcal{X}\coloneqq$ $\{\mathcal{X}_h:h\in [H]\}$ . We first present our main theorem for the finite dimensional case i.e. when $\mathcal{X}_h\subset \mathbb{R}^d$ for all timesteps $h$ . + +Theorem 4.1. (Finite-dimensional case) Suppose $(\mathcal{H},\ell ,\Pi_{\mathrm{est}},\mathcal{M})$ is a Bilinear Class with $\chi_h\subset \mathbb{R}^d$ for all timesteps $h$ and Assumption 4.1 holds. Assume $\sup_{f\in \mathcal{H},h\in [H]}\| W_h(f)\| _2\leq B_W$ and $\sup_{f\in \mathcal{H},h\in [H]}\| X_h(f)\| _2\leq B_X.$ Fix $\delta \in (0,1 / 3)$ and batch sample size $m$ and define: + +$$ +\widetilde {d} _ {m} = H \left[ 3 d \ln \left(1 + \frac {3 B _ {X} ^ {2} B _ {W} ^ {2}}{\varepsilon_ {\text {g e n}} ^ {2} (m , \mathcal {H})}\right) \right]. +$$ + +Set the parameters as: number of iterations $T = \widetilde{d}_m$ and confidence radius $R = \sqrt{T} \varepsilon_{gen}(m, \mathcal{H}) \cdot \text{conf}(\delta/(TH))$ . With probability at least $1 - \delta$ , Algorithm 1 uses at most $mHT$ trajectories and returns a hypothesis $f$ such that: + +$$ +V ^ {\star} (s _ {0}) - V ^ {\pi_ {f}} (s _ {0}) \leq 3 H \varepsilon_ {g e n} (m, \mathcal {H}) \cdot \left(1 + \sqrt {\widetilde {d} _ {m}} \cdot c o n f \left(\frac {\delta}{\widetilde {d} _ {m} H}\right)\right). +$$ + +As discussed in the Remark 4.1, $\varepsilon_{\mathrm{gen}}(m,\mathcal{H})$ and $\mathrm{conf}(\delta)$ measure the uniform convergence of discrepancy functions $\ell_f$ for the hypothesis class $\mathcal{H}$ . Therefore, if $\varepsilon_{\mathrm{gen}}(m,\mathcal{H})$ decays at least as fast as $m^{-\alpha}$ for any constant $\alpha$ , we will get efficient reinforcement learning. In fact, we will see in our examples (Section 4.2), that this is true for all known models where efficient reinforcement learning is possible. One such example is finite hypothesis classes where we immediately get the following sample complexity bound showing only a logarithmic dependence on the size of the hypothesis space. + +Corollary 4.1. (Finite-dimensional, Finite Hypothesis Case) Suppose $(\mathcal{H},\ell ,\Pi_{\mathrm{est}},\mathcal{M})$ is a Bilinear Class with $\mathcal{X}_h\subset \mathbb{R}^d$ for all timesteps $h$ $|\mathcal{H}| > 1$ and Assumption 4.1 holds. Assume $\sup_{f\in \mathcal{H},h\in [H]}\| W_h(f)\| _2\leq B_W$ and $\sup_{f\in \mathcal{H},h\in [H]}\| X_h(f)\| _2\leq B_X$ for some $B_{X},B_{W}\geq$ 1. Assume the discrepancy function $\ell_f$ is bounded i.e. $\sup_{f\in \mathcal{H}}|\ell_f(\cdot)|\leq H + 1.$ Fix $\delta \in (0,1 / 3)$ and $\epsilon \in (0,1)$ Then there exists absolute constants $c_{1},c_{2},c_{3},c_{4}$ such that setting the parameters: batch sample size + +$$ +m = \frac {c _ {1} \nu d H ^ {5} \ln (d H ^ {2}) \ln (| \mathcal {H} |) \ln (1 / \delta)}{\epsilon^ {2}}, +$$ + +number of iterations $T = c_{2}dH\ln \left(B_{X}B_{W}m\right)$ and confidence radius $R = c_{3}\sqrt{T}\cdot H\sqrt{\ln(|\mathcal{H}|) / m}\cdot \ln (TH / \delta)$ , with probability at least $1 - \delta$ , Algorithm 1 returns a hypothesis $f$ such that $V^{\star}(s_0) - V^{\pi_f}(s_0)\leq \epsilon$ using at most + +$$ +\frac {c _ {4} \nu^ {2} d ^ {2} H ^ {7} \ln (d H ^ {2}) \ln (| \mathcal {H} |) \ln (1 / \delta)}{\epsilon^ {2}} +$$ + +trajectories where + +$$ +\nu = \ln \left(\frac {d H B _ {X} B _ {W} \ln (| \mathcal {H} |) \ln (1 / \delta)}{\epsilon}\right). +$$ + +The proof for this corollary follows from bounds on $\varepsilon_{\mathrm{gen}}(m,\mathcal{H})$ and $\operatorname{conf}(\delta)$ using Hoeffding's inequality (Lemma G.1). We present the complete proof in Appendix D. + +Our next results will be non-parametric in nature and therefore it is helpful to introduce the maximum information gain (Srinivas et al., 2009), which captures an important notion of the effective dimension of a set. Let $\mathcal{X} \subset \mathcal{V}$ , where $\mathcal{V}$ is a Hilbert space. For $\lambda > 0$ and integer $n > 0$ , the maximum information gain $\gamma_{n}(\lambda; \mathcal{X})$ is defined as: + +$$ +\gamma_ {n} (\lambda ; \mathcal {X}) := \max _ {x _ {0} \dots x _ {n - 1} \in \mathcal {X}} \ln \det \left(\mathrm {I} + \frac {1}{\lambda} \sum_ {t = 0} ^ {n - 1} x _ {t} x _ {t} ^ {\top}\right). \tag {3} +$$ + +If $\mathcal{X}$ is of the form $\mathcal{X} = \{\mathcal{X}_h:h\in [H]\}$ , we use the notation + +$$ +\gamma_ {n} (\lambda ; \mathcal {X}) := \sum_ {h \in [ H ]} \gamma_ {n} (\lambda ; \mathcal {X} _ {h}). \tag {4} +$$ + +Define critical information gain, denoted by $\widetilde{\gamma} (\lambda ;\mathcal{X})$ , as the smallest integer $k > 0$ s.t. $k\geq \gamma_{k}(\lambda ;\mathcal{X})$ , i.e. + +$$ +\widetilde {\gamma} (\lambda ; \mathcal {X}) := \min _ {k \geq \gamma_ {k} (\lambda ; \mathcal {X})} k, \tag {5} +$$ + +(where $k$ is an integer). Note that such a $\widetilde{\gamma} (\lambda ;\mathcal{X})$ exists provided that the information gain $\gamma_{n}(\lambda ;\mathcal{X})$ has a sufficiently mild growth condition in both $n$ and $1 / \lambda$ . The critical information gain can be viewed as an analogous quantity to the critical radius, a quantity which arises in non-parametric statistics (Wainwright, 2019). + +Remark 4.2. For finite dimension setting where $\mathcal{X} \subset \mathbb{R}^d$ and $\|x\| \leq B_X$ for any $x \in \mathcal{X}$ , we have: $\gamma_n(\lambda; \mathcal{X}) \leq d\ln(1 + nB_X^2 / d\lambda)$ and $\tilde{\gamma}(\lambda; \mathcal{X}) \leq 3d\ln(1 + 3B_X^2 / \lambda)$ (see Lemma G.3 for a proof). Note that $1 / \lambda, n,$ and the norm bound $B_X$ only appear inside the log. Furthermore, it is possible that $\gamma_n(\lambda; \mathcal{X})$ is much smaller than the dimension of $\mathcal{X}$ (or $\mathcal{V}$ ), when the eigenspectrum of the covariance matrices concentrates in a low-dimension subspace. In fact when $\mathcal{X}$ belongs to some infinite dimensional RKHS, $\gamma_n(\lambda; \mathcal{X})$ could still be small (Srinivas et al., 2009). + +We now present our main theorem. Recall the definitions $\mathcal{X}_h\coloneqq \{X_h(f)\colon f\in \mathcal{H}\}$ and $\mathcal{X}\coloneqq \{\mathcal{X}_h:h\in [H]\}$ . + +Theorem 4.2. (RKHS case) Suppose $(\mathcal{H},\ell ,\Pi_{\mathrm{est}},\mathcal{M})$ is a Bilinear Class and Assumption 4.1 holds. Assume $\sup_{f\in \mathcal{H},h\in [H]}\| W_h(f)\| _2\leq B_W$ . Fix $\delta \in (0,1 / 3)$ , batch sample size $m$ , and define: + +$$ +\widetilde {d} _ {m} = \widetilde {\gamma} \left(\varepsilon_ {g e n} ^ {2} (m, \mathcal {H}) / B _ {W} ^ {2}; \mathcal {X}\right). +$$ + +Set the parameters as: number of iterations $T = \widetilde{d}_m$ and confidence radius $R = \sqrt{\widetilde{d}_m} \varepsilon_{gen}(m, \mathcal{H}) \cdot \text{conf}(\delta / (\widetilde{d}_m H))$ . With probability at least $1 - \delta$ , Algorithm 1 uses at most $mH d_m$ trajectories and returns a hypothesis $f$ such that: + +$$ +V ^ {\star} (s _ {0}) - V ^ {\pi_ {f}} (s _ {0}) \leq 3 H \varepsilon_ {g e n} (m, \mathcal {H}) \cdot \left(1 + \sqrt {\widetilde {d} _ {m}} \cdot c o n f \left(\frac {\delta}{\widetilde {d} _ {m} H}\right)\right). +$$ + +Next, we provide an elementary and detailed proof for our main theorem using an elliptical potential argument. + +# 4.2. Corollaries for Particular Models + +In this section, we apply our main theorem to special models: linear $Q^{\star} / V^{\star}$ , bellman complete, linear mixture model, and low occupancy complexity model. While linear bellman complete and linear mixture model have been studied, our results extend to infinite dimensional RKHS setting. Due to space constraints, we present the finite dimensional results in this section and defer the infinite dimensional results to Appendix D. + +# 4.2.1. LINEAR $Q^{\star} / V^{\star}$ + +In this subsection, we provide the sample complexity result for the linear $Q^{\star} / V^{\star}$ model (Definition 3.5). To state our results for linear $Q^{\star} / V^{\star}$ , we define the following sets: + +$$ +\Phi = \left\{\phi (s, a) \colon (s, a) \in \mathcal {S} \times \mathcal {A} \right\}, \Psi = \left\{\psi \left(s ^ {\prime}\right) \colon s ^ {\prime} \in \mathcal {S} \right\}. +$$ + +and define the concatenation set + +$$ +\Phi \circ \Psi = \left\{[ x, y ]: x \in \Phi , y \in \Psi \right\} +$$ + +Corollary 4.2 (Finite Dimensional Linear $Q^{\star} / V^{\star}$ ). Suppose MDP $\mathcal{M}$ is a linear $Q^{\star} / V^{\star}$ model with $\Phi \circ \Psi \subset \mathbb{R}^d$ . Assume $\sup_{(w,\theta)\in \mathcal{H}_h,h\in [H]}\| [w,\theta ]\| _2\leq B_W$ and $\sup_{x\in \Phi \circ \Psi}\| x\| _2\leq B_X$ for some $B_{X},B_{W}\geq 1$ . Fix $\delta \in (0,1 / 3)$ and $\epsilon \in (0,H)$ . There exists an appropriate setting of batch sample size $m$ , number of iteration $T$ and confidence radius $R$ such that with probability at least $1 - \delta$ , Algorithm 1 returns a hypothesis $f$ such that $V^{\star}(s_0) - V^{\pi_f}(s_0)\leq \epsilon$ using at most + +$$ +c _ {1} \frac {d ^ {3} H ^ {6} \ln (1 / \delta)}{\epsilon^ {2}} \cdot \left(\ln \left(\frac {d ^ {3} H ^ {7} B _ {X} ^ {2} B _ {W} ^ {2} \ln (1 / \delta)}{\epsilon^ {2}}\right)\right) ^ {5} +$$ + +trajectories for some absolute constant $c_{1}$ . + +# 4.2.2. BELLMAN COMPLETE. + +In this subsection, we provide the sample complexity result for the Linear Bellman Complete model (Definition 3.6). To state our results, we define + +$$ +\Phi = \left\{\phi (s, a): s, a \in \mathcal {S} \times \mathcal {A} \right\}. +$$ + +We first provide the result for the finite dimensional case i.e. when $\Phi \subset \mathcal{V}\subset \mathbb{R}^d$ + +Corollary 4.3 (Finite Dimensional Linear Bellman Complete). Suppose $\mathcal{H}$ is Bellman Complete with respect to MDP $\mathcal{M}$ for some Hilbert space $\mathcal{V} \subset \mathbb{R}^d$ . Assume $\sup_{\theta \in \mathcal{H}_h, h \in [H]} \| \theta \|_2 \leq B_W$ and $\sup_{x \in \Phi} \| x \|_2 \leq B_X$ for some $B_X, B_W \geq 1$ . Fix $\delta \in (0, 1/3)$ and $\epsilon \in (0, H)$ . There exists an appropriate setting of batch sample size $m$ , number of iteration $T$ and confidence radius $R$ such that with probability at least $1 - \delta$ , Algorithm 1 returns a hypothesis $f$ such that $V^\star(s_0) - V^{\pi_f}(s_0) \leq \epsilon$ using at most + +$$ +c _ {1} \frac {d ^ {3} H ^ {6} \ln (1 / \delta)}{\epsilon^ {2}} \cdot \left(\ln \left(\frac {d ^ {3} H ^ {7} B _ {X} ^ {2} B _ {W} ^ {2} \ln (1 / \delta)}{\epsilon^ {2}}\right)\right) ^ {5} +$$ + +trajectories for some absolute constant $c_{1}$ . + +In comparison, (Jin et al., 2020) has sample complexity $\widetilde{O}(d^3 H^3 / \epsilon^2 \log(1 / \delta))$ and (Zanette et al., 2020) has $\widetilde{O}(d^2 H^3 / \epsilon^2 \log(1 / \delta))$ . We prove the sample complexity result (Corollary D.2) for the RKHS case in Appendix D. Note that RKHS Linear MDP is a special instance of RKHS Bellman Complete. Prior works that studied RKHS Linear MDP either achieve worse rate (Agarwal et al., 2020a) or further assume finite covering dimension of the space of all possible upper confidence bound Q functions which are algorithm dependent quantities (Yang et al., 2020). + +# 4.2.3. LINEAR MIXTURE MODEL + +In this subsection, we provide the sample complexity result for the Linear Mixture model (Definition 3.4). To present our sample complexity results, we define: + +$$ +\begin{array}{l} \Phi_ {h} = \left\{\psi (s, a) + \sum_ {s ^ {\prime} \in \mathcal {S}} \phi (s, a, s ^ {\prime}) V _ {f; h + 1} (s ^ {\prime}) \right. \\ : (s, a) \in \mathcal {S} \times \mathcal {A}, f \in \mathcal {H} \Big \}. \\ \end{array} +$$ + +We first provide the result for the finite dimensional case i.e. when $\Phi_h\subset \mathcal{V}\subset \mathbb{R}^d$ for all $h\in [H]$ + +Corollary 4.4 (Finite Dimensional Linear Mixture Model). Suppose MDP $\mathcal{M}$ is a linear Mixture Model for some Hilbert space $\mathcal{V} \subset \mathbb{R}^d$ . Assume $\sup_{\theta \in \mathcal{H}_h, h \in [H]} \| \theta \|_2 \leq B_W$ and $\sup_{x \in \Phi_h, h \in [H]} \| x \|_2 \leq B_X$ for some $B_X, B_W \geq 1$ . Fix $\delta \in (0, 1/3)$ and $\epsilon \in (0, H)$ . There exists an appropriate setting of batch sample size $m$ , number of iteration $T$ and confidence radius $R$ such that with probability at least $1 - \delta$ , Algorithm 1 returns a hypothesis $f$ such that $V^\star(s_0) - V^{\pi_f}(s_0) \leq \epsilon$ using at most + +$$ +c _ {1} \frac {d ^ {3} H ^ {6} \ln (1 / \delta)}{\epsilon^ {2}} \cdot \left(\ln \left(\frac {d ^ {3} H ^ {7} B _ {X} ^ {2} B _ {W} ^ {2} \ln (1 / \delta)}{\epsilon^ {2}}\right)\right) ^ {5} +$$ + +trajectories for some absolute constant $c_{1}$ . + +In comparison, (Modi et al., 2020a) has sample complexity $\widetilde{O}(d^2 H^2 / \epsilon^2 \log(1 / \delta))$ . We will present the sample complexity result (Corollary D.3) for the infinite dimensional RKHS case in Appendix D. + +# 4.2.4. LOW OCCUPANCY COMPLEXITY + +In this section, we will prove sample complexity bounds for low occupancy complexity model (Definition 3.7). + +Corollary 4.5 (Low Occupancy Complexity). Suppose $\mathcal{H}$ has low occupancy complexity. Assume $\sup_{f\in \mathcal{H}_h,h\in [H]}\| W_h(f)\| _2\leq B_W$ . Fix $\delta \in (0,1 / 3)$ , batch sample size $m$ , and define: + +$$ +\widetilde {d} _ {m} (\mathcal {X}) = \widetilde {\gamma} \Big (\frac {8 H ^ {2} \big (1 + \ln (| \mathcal {H} |) \big)}{m B _ {W} ^ {2}}; \mathcal {X} \Big). +$$ + +Set $T = \widetilde{d}_m(\mathcal{X})$ and $R = (2\sqrt{2} H / \sqrt{m}) \cdot \sqrt{\widetilde{d}_m(\mathcal{X})} \cdot \sqrt{1 + \ln(|\mathcal{H}|)} \cdot \sqrt{\ln(\widetilde{d}_m(\mathcal{X})H) + \ln(1 / \delta)}$ . With probability greater than $1 - \delta$ , Algorithm 1 uses at most $mH\widetilde{d}_m(\mathcal{X})$ trajectories and returns a hypothesis $f$ such that $V^{\star}(s_0) - V^{\pi_f}(s_0)$ is at most: + +$$ +1 2 \sqrt {2} H ^ {2} \frac {\sqrt {\widetilde {d} _ {m} (\mathcal {X})} \cdot \sqrt {1 + \ln (| \mathcal {H} |)}}{\sqrt {m}} \cdot v, +$$ + +where $v = \sqrt{\ln\left(\widetilde{d}_m(\mathcal{X})H\right) + \ln\left(1 / \delta\right)}$ + +# 4.2.5. FINITE BELLMAN RANK + +In this section, we will prove sample complexity bounds for MDPs with finite Bellman Rank (Section 3.1). + +Corollary 4.6 (Bellman Rank). For a given MDP $\mathcal{M}$ , suppose a hypothesis class $\mathcal{H}$ has Bellman rank $d$ . Assume $\sup_{f\in \mathcal{H}_h,h\in [H]}\| W_h(f)\| _2\leq B_W$ and $\sup_{f\in \mathcal{H},h\in [H]}\| X_h(f)\| \leq B_X$ for some $B_W,B_X\geq 1$ . Fix $\delta \in (0,1 / 3)$ and $\epsilon \in (0,H)$ . There exists an appropriate setting of batch sample size $m$ , number of iteration $T$ and confidence radius $R$ such that with probability at least $1 - \delta$ , Algorithm 1 returns a hypothesis $f$ such that $V^{\star}(s_0) - V^{\pi_f}(s_0)\leq \epsilon$ using at most + +$$ +\widetilde {O} \left(\frac {d ^ {2} H ^ {7} | \mathcal {A} | (1 + \ln (| \mathcal {H} |))}{\epsilon^ {2}} \ln^ {3} \left(\frac {B _ {W} ^ {2} B _ {X} ^ {2} (1 + \ln (| \mathcal {H} |))}{\delta}\right)\right) +$$ + +trajectories. + +Note that in comparison, (Jiang et al., 2016) has sample complexity $\widetilde{O}(d^2 H^5 |\mathcal{A}| / \epsilon^2 \log(1 / \delta))$ . We present the proof in Appendix D. + +# References + +Yasin Abbasi-Yadkori, David Pál, and Csaba Szepesvári. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, 2011. +Alekh Agarwal, Mikael Henaff, Sham Kakade, and Wen Sun. PC-PG: Policy cover directed exploration for provable policy gradient learning. In Advances in Neural Information Processing Systems, 2020a. +Alekh Agarwal, Sham Kakade, Akshay Krishnamurthy, and Wen Sun. Flambe: Structural complexity and representation learning of low rank mdps. arXiv preprint arXiv:2006.10814, 2020b. +Alex Ayoub, Zeyu Jia, Csaba Szepesvari, Mengdi Wang, and Lin F Yang. Model-based reinforcement learning with value-targeted regression. arXiv:2006.01107, 2020. +Varsha Dani, Thomas P Hayes, and Sham M Kakade. Stochastic linear optimization under bandit feedback. In Conference on Learning Theory, 2008. +Sarah Dean, Horia Mania, Nikolai Matni, Benjamin Recht, and Stephen Tu. On the sample complexity of the linear quadratic regulator. Foundations of Computational Mathematics, pages 1-47, 2019. +Shi Dong, Benjamin Van Roy, and Zhengyuan Zhou. Provably efficient reinforcement learning with aggregated states, 2020. +Simon S Du, Akshay Krishnamurthy, Nan Jiang, Alekh Agarwal, Miroslav Dudík, and John Langford. Provably efficient RL with rich observations via latent state decoding. In International Conference on Machine Learning, 2019a. +Simon S Du, Yuping Luo, Ruosong Wang, and Hanrui Zhang. Provably efficient Q-learning with function approximation via distribution shift error checking oracle. In Advances in Neural Information Processing Systems, 2019b. +Simon S Du, Sham M Kakade, Ruosong Wang, and Lin F Yang. Is a good representation sufficient for sample efficient reinforcement learning? In International Conference on Learning Representations, 2020a. +Simon S Du, Jason D Lee, Gaurav Mahajan, and Ruosong Wang. Agnostic Q-learning with function approximation in deterministic systems: Tight bounds on approximation error and sample complexity. In Advances in Neural Information Processing Systems, 2020b. +Nan Jiang, Alex Kulesza, and Satinder Singh. Abstraction selection in model-based reinforcement learning. In International Conference on Machine Learning, 2015. + +Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E. Schapire. Contextual decision processes with low bellman rank are pac-learnable, 2016. +Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low Bellman rank are PAC-learnable. In International Conference on Machine Learning, 2017. +Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, 2020. +Sham Kakade, Akshay Krishnamurthy, Kendall Lowrey, Motoya Ohnishi, and Wen Sun. Information theoretic regret bounds for online nonlinear control. arXiv preprint arXiv:2006.12466, 2020. +Michael Kearns and Daphne Koller. Efficient reinforcement learning in factored mdps. In *IJCAI*, volume 16, pages 740-747, 1999. +Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238-1274, 2013. +Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Pac reinforcement learning with rich observations. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 1848-1856, 2016. +Lihong Li. A Unifying Framework for Computational Reinforcement Learning Theory. PhD thesis, USA, 2009. AAI3386797. +Michael L Littman and Richard S Sutton. Predictive representations of state. In Advances in Neural Information Processing Systems, 2002. +Michael L Littman, Richard S Sutton, and Satinder P Singh. Predictive representations of state. In NIPS, volume 14, page 30, 2001. +Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. +Aditya Modi, Nan Jiang, Ambuj Tewari, and Satinder Singh. Sample complexity of reinforcement learning using linearly combined model ensembles. In Conference on Artificial Intelligence and Statistics, 2020a. +Aditya Modi, Nan Jiang, Ambuj Tewari, and Satinder Singh. Sample complexity of reinforcement learning using linearly combined model ensembles. In International Conference on Artificial Intelligence and Statistics, pages 2010-2020. PMLR, 2020b. + +Rémi Munos. Error bounds for approximate value iteration. In Proceedings of the National Conference on Artificial Intelligence, volume 20, page 1006. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press; 1999, 2005. +David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354-359, 2017. +Niranjan Srinivas, Andreas Krause, Sham M Kakade, and Matthias Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. arXiv preprint arXiv:0912.3995, 2009. +Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Model-based RL in contextual decision processes: PAC bounds and exponential improvements over model-free approaches. In Conference on Learning Theory, 2019. +Martin J Wainwright. High-dimensional statistics: A non-asymptotic viewpoint, volume 48. Cambridge University Press, 2019. +Gellert Weisz, Philip Amortila, and Csaba Szepesvári. Exponential lower bounds for planning in mdps with linearly-realizable optimal action-value functions, 2020. +Zheng Wen and Benjamin Van Roy. Efficient exploration and value function generalization in deterministic systems. In Advances in Neural Information Processing Systems, 2013. +Cathy Wu, Kanaad Parvate, Nishant Kheterpal, Leah Dickstein, Ankur Mehta, Eugene Vinitsky, and Alexandre M Bayen. Framework for control and deep reinforcement learning in traffic. In 2017 IEEE 20th International Conference on Intelligent Transportation Systems (ITSC), pages 1-8. IEEE, 2017. +Lin Yang and Mengdi Wang. Sample-optimal parametric Q-learning using linearly additive features. In International Conference on Machine Learning, 2019. +Zhuoran Yang, Chi Jin, Zhaoran Wang, Mengdi Wang, and Michael I Jordan. Bridging exploration and general function approximation in reinforcement learning: Provably efficient kernel and neural value iterations. arXiv preprint arXiv:2011.04622, 2020. +Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal policies with low inherent bellman error, 2020. \ No newline at end of file diff --git a/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/images.zip b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..eb47f6ff73c304c40cfa990559de12f6c7a104cd --- /dev/null +++ b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f15866ec57bef66ce75e076da74aa3d3261ae408380571fdc66098503348973d +size 420221 diff --git a/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/layout.json b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f8fbd3e940afc63816aedc80b469bf8e18187a88 --- /dev/null +++ b/bilinearclassesastructuralframeworkforprovablegeneralizationinrl/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:618ed6e756c27defd62bcff6dcace84884a8708202a67ccd9eb271c7e2df98c9 +size 821475 diff --git a/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_content_list.json b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..245969b30cf0171b41271a5f9ce33704cc2466fa --- /dev/null +++ b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d6016e67d06edb02805c595330e619b515078c33933a6c2f4a64255f7ebe16a +size 91380 diff --git a/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_model.json b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5fab33415845d670637e7832288b5f1564ba4c8c --- /dev/null +++ b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9348c538b587609f32664d512af2463a14647eb5d01af4afe13831b12053298b +size 114415 diff --git a/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_origin.pdf b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a411033a0c5b3a7eef90b9bf0219ff94d79364e9 --- /dev/null +++ b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/1f0c6f5c-fc6c-454f-a9ce-abc6480fd117_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5d6f128c63a3f59f8674a245feb7b17d831bf1c2f93999b6b7a1a116fe239f7 +size 2585560 diff --git a/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/full.md b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..15785804876d176114825ebb840f5792d4ff7415 --- /dev/null +++ b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/full.md @@ -0,0 +1,413 @@ +# Binary Classification from Multiple Unlabeled Datasets via Surrogate Set Classification + +Nan Lu $^{*12}$ Shida Lei $^{*1}$ Gang Niu $^{2}$ Issei Sato $^{12}$ Masashi Sugiyama $^{21}$ + +# Abstract + +To cope with high annotation costs, training a classifier only from weakly supervised data has attracted a great deal of attention these days. Among various approaches, strengthening supervision from completely unsupervised classification is a promising direction, which typically employs class priors as the only supervision and trains a binary classifier from unlabeled (U) datasets. While existing risk-consistent methods are theoretically grounded with high flexibility, they can learn only from two U sets. In this paper, we propose a new approach for binary classification from $m$ U sets for $m \geq 2$ . Our key idea is to consider an auxiliary classification task called surrogate set classification (SSC), which is aimed at predicting from which U set each observed sample is drawn. SSC can be solved by a standard (multi-class) classification method, and we use the SSC solution to obtain the final binary classifier through a certain linear-fractional transformation. We built our method in a flexible and efficient end-to-end deep learning framework and prove it to be classifier-consistent. Through experiments, we demonstrate the superiority of our proposed method over state-of-the-art methods. + +# 1. Introduction + +Deep learning with large-scale supervised training data has shown great success on various tasks (Goodfellow et al., 2016). However, in practice, obtaining strong supervision, e.g., the complete ground-truth labels, for big data is very costly due to the expensive and time-consuming manual annotations (Zhou, 2018). Thus, it is desirable for machine learning techniques to work with weaker forms of supervision, such as noisy labels (Natarajan et al., 2013; Patrini + +$^{1}$ Equal contribution $^{1}$ The University of Tokyo, Tokyo, Japan $^{2}$ RIKEN, Tokyo, Japan. Correspondence to: Nan Lu , Shida Lei . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +et al., 2017; Van Rooyen & Williamson, 2018; Han et al., 2018; 2020; Fang et al., 2020; Xia et al., 2020), partial labels (Cour et al., 2011; Ishida et al., 2017; 2019; Feng et al., 2020; Lv et al., 2020), and pairwise comparison information (Bao et al., 2018; Xu et al., 2019; Feng et al., 2021). + +This paper focuses on a challenging setting which we call $U^{m}$ classification: the goal is to learn a binary classifier from $m$ ( $m \geq 2$ ) sets of U data with different class priors, i.e., the proportion of positives in each U set. Such a learning scheme can be conceivable in many real-world scenarios. For example, U sets with different class priors can be naturally collected from spatial or temporal differences. Considering morbidity rates, they can be potential patient data collected from different areas (Croft et al., 2018). Likewise, considering approval rates, they can be unlabeled voter data collected in different years (Newman, 2003). In such cases, individual labels are often not available due to privacy reasons, but the corresponding class priors of U sets, i.e., the morbidity rates or approval rates in the aforementioned examples, can be obtained from related medical reports or pre-existing census (Quadrianto et al., 2009; Ardehaly & Culotta, 2017; Tokunaga et al., 2020), and is the unique weak supervision that will be leveraged in this work. + +Breakthroughs in $\mathrm{U}^m$ classification research were brought by Menon et al. (2015) and Lu et al. (2019) in proposing the risk-consistent methods given two U sets. Recently, Scott & Zhang (2020) extended them to incorporate multiple U sets by two steps: firstly, pair all the U sets so that they are sufficiently different in each pair; secondly, linearly combine the unbiased balanced risk estimators obtained from each pair. Although this method is advantageous since it is compatible with any model and stochastic optimizer, and is statistically consistent, there are several issues that may limit its potential for practical use: first, the computational complexity for the optimal pairing strategy is $O(m^3)$ for $m$ U sets (Edmonds & Karp, 1972), which cannot work efficiently with a large number of U sets; second, the optimal combination weights are proved with strong model assumptions and thus remaining difficult to be tuned in practice. + +Now, a natural question arises: can we propose a computationally efficient method for $\mathbf{U}^m$ classification with both flexibility on the choice of models and optimizers and theo + +retical guarantees? The answer is affirmative. + +In this paper, we provide a new approach for $\mathbf{U}^m$ classification by solving a Surrogate Set Classification task ( $\mathbf{U}^m$ -SSC). More specifically, we regard the index of each U set as a surrogate-set label and consider the supervised multi-class classification task of predicting the surrogate-set labels given observations. The difficulty is how to link our desired binary classifier with the learned surrogate multiclass classifier. To solve it, we theoretically bridge the original and surrogate class-posterior probabilities with a linear-fractional transformation, and then implement it by adding a transition layer to the neural network so that the trained model is guaranteed to be a good approximation of the original class-posterior probability. Our proposed $\mathbf{U}^m$ -SSC scheme is built within an end-to-end framework, which is computationally efficient, compatible with any model architecture and stochastic optimization, and naturally incorporates multiple U sets. Our contributions can be summarized as follows: + +- Theoretically, we prove that the proposed $\mathrm{U}^m$ -SSC method is classifier-consistent (Patrini et al., 2017; Lv et al., 2020), i.e., the classifier learned by solving the surrogate set classification task from multiple sets of U data converges to the optimal classifier learned from fully supervised data under mild conditions. Then we establish an estimation error bound of our method. +- Practically, we propose an easy-to-implement, flexible, and computationally efficient method for $\mathrm{U}^m$ classification, which is shown to outperform the state-of-the-art methods in experiments. We also verify the robustness of the proposed method by simulating $\mathrm{U}^m$ classification in the wild, e.g., on varied set sizes, set numbers, noisy class priors, and the results are promising. + +Our method provides new perspectives of solving the $\mathbf{U}^m$ classification problem, and is more suitable to be applied in practice given its theoretical and practical advantages. + +# 2. Problem Setup and Related Work + +In this section, we introduce some notations, formulate the $\mathbf{U}^m$ classification problem, and review the related work. + +# 2.1. Learning from Fully Labeled Data + +Let $\mathcal{X}$ be the input feature space and $\mathcal{Y} = \{+1, -1\}$ be a binary label space, $x \in \mathcal{X}$ and $y \in \mathcal{Y}$ be the input and output random variables following an underlying joint distribution $\mathcal{D}$ . Let $f: \mathcal{X} \to \mathbb{R}$ be an arbitrary binary classifier, and $\ell_{\mathrm{b}}(t, y): \mathbb{R} \times \mathcal{Y} \to \mathbb{R}_{+}$ be a loss function such that the value $\ell_{\mathrm{b}}(t, y)$ means the loss by predicting $t$ when the ground-truth is $y$ . The goal of binary classification is to train a classifier $f$ that minimizes the risk defined as + +$$ +R (f) = \mathbb {E} _ {(\boldsymbol {x}, y) \sim \mathcal {D}} [ \ell_ {\mathrm {b}} (f (\boldsymbol {x}), y) ] \tag {1} +$$ + +where $\mathbb{E}$ denotes the expectation. For evaluation, $\ell_{\mathrm{b}}$ is often chosen as $\ell_{01}(t,y) = (1 - \mathrm{sign}((t - \frac{1}{2})\cdot y)) / 2$ and then the risk $R$ becomes the standard performance measure for classification, a.k.a. the classification error. For training, $\ell_{01}$ is replaced by a surrogate loss, e.g., the logistic loss $\ell_{\log}(t,y) = \ln (1 + \exp (-t\cdot y))$ , since $\ell_{01}$ is discontinuous and therefore difficult to optimize (Ben-David et al., 2003). + +In most cases, $R$ cannot be calculated directly because the joint distribution $\mathcal{D}$ is unknown to the learner. Given the labeled training set $\mathcal{X} = \{(x_i, y_i)\}_{i=1}^n \stackrel{\text{i.i.d.}}{\sim} \mathcal{D}$ with $n$ samples, empirical risk minimization (ERM) (Vapnik, 1998) is a common practice that computes an approximation of $R$ by + +$$ +\widehat {R} (f) = \frac {1}{n} \sum_ {i = 1} ^ {n} \ell_ {\mathrm {b}} \left(f \left(\boldsymbol {x} _ {i}\right), y _ {i}\right). \tag {2} +$$ + +# 2.2. Learning from Multiple Sets of U Data + +Next, we consider $\mathrm{U}^m$ classification. We are given $m(m\geq 2)$ sets of unlabeled samples drawn from $m$ marginal densities $\{p_{\mathrm{tr}}^j (\pmb {x})\}_{j = 1}^m$ , where + +$$ +p _ {\mathrm {t r}} ^ {j} (\boldsymbol {x}) = \pi_ {j} p _ {\mathrm {p}} (\boldsymbol {x}) + (1 - \pi_ {j}) p _ {\mathrm {n}} (\boldsymbol {x}), \tag {3} +$$ + +each $p_{\mathrm{tr}}^j(\pmb{x})$ is seen as a mixture of the positive and negative class-conditional densities $(p_{\mathrm{p}}(\pmb{x}), p_{\mathrm{n}}(\pmb{x})) = (p(\pmb{x} | y = +1), p(\pmb{x} | y = -1))$ , and $\pi_j = p_{\mathrm{tr}}^j(y = +1)$ denotes the class prior of the $j$ -th U set. Note that given only U data, it is theoretically impossible to learn the class priors without any assumptions (Menon et al., 2015), so we assume all necessary class priors are given, which are the only weak supervision we will leverage. To make the problem mathematically solvable, among the $m$ sets of U data, we also assume that at least two of them are different, i.e., $\exists j, j' \in \{1, \dots, m\}$ such that $j \neq j'$ and $\pi_j \neq \pi_{j'}$ . + +In contrast to supervised classification where we have a fully labeled training set $\mathcal{X}$ directly drawn from $\mathcal{D}$ , now we only have access to $m$ sets of U data $\mathcal{X}_{\mathrm{tr}} = \{\mathcal{X}_{\mathrm{tr}}^j\}_{j=1}^m$ , where + +$$ +\mathcal {X} _ {\mathrm {t r}} ^ {j} = \left\{\boldsymbol {x} _ {1} ^ {j}, \dots , \boldsymbol {x} _ {n _ {j}} ^ {j} \right\} \stackrel {\text {i . i . d .}} {\sim} p _ {\mathrm {t r}} ^ {j} (\boldsymbol {x}), \tag {4} +$$ + +and $n_j$ denotes the sample size of the $j$ -th U set. But our goal is still the same as supervised classification: to obtain a binary classifier that generalizes well with respect to $\mathcal{D}$ , despite the fact that it is unobserved. + +# 2.3. Related Work + +Here, we review some related works for $\mathbf{U}^m$ classification. + +Table 1. Comparisons of the proposed method with previous works in the $\mathrm{U}^{m}$ classification setting. + +
MethodsDeal with 2+ setsTheoretical guaranteeNo negative training riskPre-computing complexityRisk Measure
\(\widehat{R}_{\mathrm{U}^2}(f)\) (Lu et al., 2019)×✓×O(1)Classification risk (1)
\(\widehat{R}_{\mathrm{U}^2\text{-b}}(f)\) (Menon et al., 2015)×✓×O(1)Balanced risk (7)
\(\widehat{R}_{\mathrm{U}^2\text{-c}}(f)\) (Lu et al., 2020)×✓✓O(1)Classification risk (1)
\(\widehat{R}_{\mathrm{U}^{\mathrm{m}}}(f)\) (Scott & Zhang, 2020)✓✓×O(m3)Balanced risk (7)
\(\widehat{R}_{\mathrm{prop-c}}(f)\) (Tsai & Lin, 2020)✓×✓O(1)Proportion risk (5)
Proposed✓✓✓O(1)Classification risk (1)
+ +Clustering methods Learning from only U data is previously regarded as discriminative clustering (Xu et al., 2004; Gomes et al., 2010). However, these methods are often suboptimal since they rely on a critical assumption that one cluster exactly corresponds to one class, and hence even perfect clustering may still result in poor classification. As a consequence, we prefer ERM to clustering. + +Proportion risk methods The $\mathrm{U}^m$ classification setting is also related to learning with label proportions (LLP), with a subtle difference in the experimental design. However, most LLP methods are not ERM-based, but based on the following empirical proportion risk (EPR) (Yu et al., 2014): + +$$ +\widehat {R} _ {\text {p r o p}} (f) = \sum_ {j = 1} ^ {m} d _ {\text {p r o p}} \left(\pi_ {j}, \hat {\pi} _ {j}\right), \tag {5} +$$ + +where $\pi_j$ and $\hat{\pi}_j = \frac{1}{n_j}\sum_{i=1}^{n_j}(1 + \mathrm{sign}(f(\pmb{x}_i^j) - 1/2)) / 2$ are the true and predicted label proportions for the $j$ -th U set $\mathcal{X}_{\mathrm{tr}}^j$ , and $d_{\mathrm{prop}}$ is a distance function. State-of-the-art method in this line combined EPR with consistency regularization and proposed the following learning objective: + +$$ +\widehat {R} _ {\mathrm {p r o p - c}} (f) = \widehat {R} _ {\mathrm {p r o p}} (f) + \alpha \ell_ {\mathrm {c o n s}} (f), \tag {6} +$$ + +where $\ell_{\mathrm{cons}}(f) = d_{\mathrm{cons}}(f(\pmb{x}), f(\hat{\pmb{x}}))$ is the consistency loss given a distance function $d_{\mathrm{cons}}$ and $\hat{\pmb{x}}$ is a perturbed input from the original one $\pmb{x}$ (Tsai & Lin, 2020). + +Classification risk methods A breakthrough of the ERM-based method for $\mathrm{U}^m$ classification is Lu et al. (2019) which assumed $m = 2$ and $\pi_1 > \pi_2$ , and proposed an equivalent expression of the classification risk (1): + +$$ +\begin{array}{l} R _ {\mathrm {U} ^ {2}} (f) = \underbrace {\mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {t r}} ^ {1}} c _ {1} ^ {+} \ell_ {\mathrm {b}} (f (\boldsymbol {x}) , + 1) - \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {t r}} ^ {2}} c _ {2} ^ {+} \ell_ {\mathrm {b}} (f (\boldsymbol {x}) , + 1)} _ {R _ {\mathrm {U} ^ {2}, \mathrm {p}} (f)} \\ \underbrace {- \mathbb {E} _ {\pmb {x} \sim p _ {\mathrm {t r}} ^ {1}} c _ {1} ^ {-} \ell_ {\mathrm {b}} (f (\pmb {x}) , - 1) + \mathbb {E} _ {\pmb {x} \sim p _ {\mathrm {t r}} ^ {2}} c _ {2} ^ {-} \ell_ {\mathrm {b}} (f (\pmb {x}) , - 1)} _ {R _ {\mathrm {U ^ {2} . n}} (f)}, \\ \end{array} +$$ + +where $c_{1}^{+} = \frac{(1 - \pi_{2})\pi_{\mathcal{D}}}{\pi_{1} - \pi_{2}}$ , $c_{1}^{-} = \frac{\pi_{2}(1 - \pi_{\mathcal{D}})}{\pi_{1} - \pi_{2}}$ , $c_{2}^{+} = \frac{(1 - \pi_{1})\pi_{\mathcal{D}}}{\pi_{1} - \pi_{2}}$ , $c_{2}^{-} = \frac{\pi_{1}(1 - \pi_{\mathcal{D}})}{\pi_{1} - \pi_{2}}$ , and $\pi_{\mathcal{D}}$ denotes the class prior of the test set. If $\pi_{\mathcal{D}}$ is assumed to be $\frac{1}{2}$ in $R_{\mathrm{U}^2}(f)$ , the obtained $R_{\mathrm{U}^2 -\mathrm{b}}(f)$ (Menon et al., 2015) corresponds to the balanced risk, a.k.a. the balanced error (Brodersen et al., 2010): + +$$ +R _ {\mathrm {b}} (f) = \frac {1}{2} \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {p}}} [ \ell_ {\mathrm {b}} (f (\boldsymbol {x}), + 1) ] + \frac {1}{2} \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {n}}} [ \ell_ {\mathrm {b}} (f (\boldsymbol {x}), - 1) ], \tag {7} +$$ + +where $\ell_{\mathrm{b}}$ is $\ell_{01}$ . Note that $R_{\mathrm{b}}(f) = R(f)$ for any $f$ if and only if $\pi_{\mathcal{D}} = \frac{1}{2}$ , which means that it definitely biases learning when $\pi_{\mathcal{D}} \approx \frac{1}{2}$ is not the case. Given $\mathcal{X}_{\mathrm{tr}}^{1}$ and $\mathcal{X}_{\mathrm{tr}}^{2}$ , $R_{\mathrm{U}^2}(f)$ and $R_{\mathrm{U}^2 - \mathrm{b}}(f)$ can be approximated by their empirical counterparts $\widehat{R}_{\mathrm{U}^2}(f)$ and $\widehat{R}_{\mathrm{U}^2 - \mathrm{b}}(f)$ . + +It is shown in Lu et al. (2020) that the empirical training risk $\widehat{R}_{\mathrm{U}^2}(f)$ can take negative values which causes overfitting, so they proposed a corrected learning objective that wraps the empirical risks of the positive class $\widehat{R}_{\mathrm{U}^2 -\mathrm{p}}(f)$ and the negative class $\widehat{R}_{\mathrm{U}^2 -\mathrm{n}}(f)$ into some non-negative correction function $f_{\mathrm{c}}$ , such that $f_{\mathrm{c}}(x) = x$ for all $x\geq 0$ and $f_{\mathrm{c}}(x) > 0$ for all $x < 0$ : $\widehat{R}_{\mathrm{U}^2 -\mathrm{c}}(f) = f_{\mathrm{c}}(\widehat{R}_{\mathrm{U}^2 -\mathrm{p}}(f)) + f_{\mathrm{c}}(\widehat{R}_{\mathrm{U}^2 -\mathrm{n}}(f))$ . Note that $\widehat{R}_{\mathrm{U}^2 -\mathrm{c}}$ is biased with finite samples, but Lu et al. (2020) showed its risk-consistency, i.e., it converges to the original risk $R$ in (1) if $n_1,n_2\to \infty$ + +Although these risk-consistent methods are advantageous in terms of flexibility and theoretical guarantees, they are limited to 2 U sets. Recently, Scott & Zhang (2020) extended the previous method for the general $m(m \geq 2)$ setting. More specifically, they assumed the number of sets $m = 2k$ and proposed a pre-processing step that finds $k$ pairs of the U sets by solving a maximum weighted matching problem (Edmonds, 1965). Then they linearly combine the unbiased balanced risk estimator of each pair. The resulted weighted learning objective is given by + +$$ +\widehat {R} _ {\mathrm {U} ^ {\mathrm {m}}} (f) = \sum_ {j = 1} ^ {k} \omega_ {j} \widehat {R} _ {\mathrm {U} ^ {2} - \mathrm {b}} (f). \tag {8} +$$ + +This method is promising but has some practical issues: + +the pairing step is computationally very inefficient and the weights are hard to tune in practice. + +A comparison of the previous works with our proposed method that will be introduced in Sec. 3 is given in Table 1. + +# 3. $\mathbf{U}^{m}$ classification via Surrogate Set Classification + +In this section, we propose a new ERM-based method for learning from multiple U sets via a surrogate set classification task and analyze it theoretically. All the proofs are given in Appendix A. + +# 3.1. Surrogate Set Classification Task + +The main challenge in the $\mathrm{U}^m$ classification problem is that we have no access to the ground-truth labels of the training examples so that the empirical risk (2) in supervised binary classification cannot be computed directly. Our idea is to consider a surrogate set classification task that could be tackled easily from the given U sets. It serves as a proxy and gives us a classifier-consistent solution to the original binary classification problem. + +Specifically, denote by $\bar{y} \in \{1,2,\dots,m\}$ the index of the U set, i.e., the index of the corresponding marginal density. By treating $\bar{y}$ as a surrogate label, we formulate the surrogate set classification task as the standard multi-class classification. Let $\bar{\mathcal{D}}$ be the joint distribution for the random variables $x \in \mathcal{X}$ and $\bar{y} \in \bar{\mathcal{Y}} = \{1,2,\dots,m\}$ . Any $\bar{\mathcal{D}}$ can be identified via the class priors $\{\rho_{j} = p(\bar{y} = j)\}_{j=1}^{m}$ and the class-conditional densities $\{p(\boldsymbol{x} \mid \bar{y} = j) = p_{\mathrm{tr}}^{j}(\boldsymbol{x})\}_{j=1}^{m}$ , where $\rho_{j}$ can be estimated by $\rho_{j} = \frac{n_{j}}{\sum_{j=1}^{m} n_{j}}$ . + +The goal of surrogate set classification is to train a classifier $g(\pmb{x}) : \mathcal{X} \to \mathbb{R}^m$ that minimizes the following risk: + +$$ +R _ {\text {s u r r}} (\boldsymbol {g}) = \mathbb {E} _ {(\boldsymbol {x}, \bar {y}) \sim \bar {\mathcal {D}}} [ \ell (\boldsymbol {g} (\boldsymbol {x}), \bar {y}) ], \tag {9} +$$ + +where $\ell (\pmb {g}(\pmb {x}),\bar{y}):\mathbb{R}^m\times \bar{\mathcal{V}}\to \mathbb{R}_+$ is a proper loss for $m$ -class classification, e.g., the cross-entropy loss: + +$$ +\ell_ {\mathrm {c e}} (\boldsymbol {g} (\boldsymbol {x}), \bar {y}) = - \sum_ {j = 1} ^ {m} \mathbf {1} (\bar {y} = j) \log (g _ {j} (\boldsymbol {x})) = - \log (g _ {\bar {y}} (\boldsymbol {x})), +$$ + +where $\mathbf{1}(\cdot)$ is the indicator function, $g_{j}(\pmb {x})$ is the $j$ -th element of $\pmb {g}(\pmb {x})$ , and is a score function that estimates the true class-posterior probability $\bar{\eta}_j(\pmb {x}) = p(\bar{y} = j\mid \pmb {x})$ . Typically, the predicted label $\bar{y}_{\mathrm{pred}}$ takes the form $\bar{y}_{\mathrm{pred}} = \operatorname{argmax}_{j\in [m]}g_j(\pmb {x})$ . + +Now the unlabeled training sets given by (4) for the binary classification can be seen as a labeled training set $\mathcal{X}_{\mathrm{tr}} = \{(x_i,\bar{y}_i)\}_{j = 1}^{n_{\mathrm{tr}}}\stackrel {\mathrm{i.i.d.}}{\sim}\bar{D}$ for the $m$ -class classification, where $n_{\mathrm{tr}} = \sum_{j = 1}^{m}n_{j}$ is the total number of U data. We can use + +$\mathcal{X}_{\mathrm{tr}}$ to approximate the risk $R_{\mathrm{surr}}$ by + +$$ +\widehat {R} _ {\text {s u r r}} (\boldsymbol {g}) = \frac {1}{n _ {\mathrm {t r}}} \sum_ {i = 1} ^ {n _ {\mathrm {t r}}} \ell \left(\boldsymbol {g} \left(\boldsymbol {x} _ {i}\right), \bar {y} _ {i}\right). \tag {10} +$$ + +# 3.2. Bridge Two Posterior Probabilities + +Let $\eta(\boldsymbol{x}) = p(y = +1 \mid \boldsymbol{x})$ be the class-posterior probability for class $+1$ in the original binary classification problem, and $\bar{\eta}_j(\boldsymbol{x}) = p(\bar{y} = j \mid \boldsymbol{x})$ be the class-posterior probability for class $j$ in the surrogate set classification problem. We theoretically bridge them by the following theorem. + +Theorem 1. By the definitions of $\mathcal{D}$ , $\eta(\pmb{x})$ , $\bar{\mathcal{D}}$ , and $\bar{\eta}_j(\pmb{x})$ , we have + +$$ +\bar {\eta} _ {j} (\boldsymbol {x}) = T _ {j} \left(\eta (\boldsymbol {x})\right), \quad \forall j = 1, \dots , m, \tag {11} +$$ + +where + +$$ +T _ {j} (\eta (\boldsymbol {x})) = \frac {a _ {j} \cdot \eta (\boldsymbol {x}) + b _ {j}}{c \cdot \eta (\boldsymbol {x}) + d}, +$$ + +$$ +\begin{array}{l} a _ {j} = \rho_ {j} (\pi_ {j} - \pi_ {\mathcal {D}}), b _ {j} = \rho_ {j} \pi_ {\mathcal {D}} (1 - \pi_ {j}), c = \sum_ {j = 1} ^ {m} \rho_ {j} (\pi_ {j} - \\ \pi_ {\mathcal {D}}), a n d d = \sum_ {j = 1} ^ {m} \rho_ {j} \pi_ {\mathcal {D}} (1 - \pi_ {j}). \end{array} +$$ + +Such a relationship has been previously studied by Menon et al. (2015) in the context of corrupted label learning for a specific $2 \times 2$ case, i.e., 2 clean classes are transformed to 2 corrupted classes, and they used $T_{j}(\cdot)$ to post-process the threshold of the score function learned from corrupted data. Our proposal can be regarded as its extension to a general $2 \times m$ case and $T_{j}(\cdot)$ is used to connect the original binary classifier with the surrogate multi-set-class classifier. + +Let $\pmb{T}(\cdot):\mathbb{R}\rightarrow \mathbb{R}^m$ be a vector form of the transition function $T(\cdot) = [T_{1}(\cdot),\dots ,T_{m}(\cdot)]^{\top}$ . Note that the coefficients in $T_{j}(\cdot)$ are all constants and $\pmb{T}(\cdot)$ is deterministic. Next, we study properties of the transition function $\pmb{T}$ in the following lemma, which implies the feasibility of approaching $\eta (\pmb {x})$ by means of estimating $\bar{\eta}_j(\pmb {x})$ . + +Lemma 2. The transition function $T(\cdot)$ is an injective function in the domain [0, 1]. + +# 3.3. Classifier-consistent Algorithm + +Given the transition function $T$ , we have two choices to obtain $\eta(\pmb{x})$ from $\bar{\eta}_j(\pmb{x})$ . First, one can estimate $\bar{\eta}_j(\pmb{x})$ , then calculate $\eta(\pmb{x})$ via the inverse function $T_j^{-1}(\bar{\eta}_j(\pmb{x}))$ . Second, one can encode $\eta(\pmb{x})$ as a latent variable into the computation of $\bar{\eta}_j(\pmb{x})$ and obtain both of them simultaneously. We prefer the latter for three reasons. + +- Computational efficiency: the latter is a one-step solution and avoids additional computations of the inverse functions, which provides computational efficiency and easiness for implementation. +- Robustness: since the coefficients of $T_{j}(\cdot)$ may be perturbed by some noise in practice, its inversion in + +Algorithm 1 $\mathbf{U}^m$ -SSC based on stochastic optimization +Input: Model $f$ $m$ sets of unlabeled data $\mathcal{X}_{\mathrm{tr}}$ , class priors $\{\pi_j\}_{j = 1}^m$ and $\pi_{\mathcal{D}}$ +1: Compute $a_{j},b_{j},c$ and $d$ of $\pmb {T}(\cdot) = [T_1(\cdot),\dots,T_m(\cdot)]^\top$ in Theorem 1 using $\{\pi_j\}_{j = 1}^m$ and $\pi_{\mathcal{D}}$ +2: Let $\pmb {g} = \pmb {T}(f)$ and $\mathcal{A}$ be a SGD-like optimizer working on $\pmb{g}$ +3: for $t = 1,2,\ldots ,$ number_of_epochs do +4: Shuffle $\mathcal{X}_{\mathrm{tr}}$ +5: for $i = 1,2,\dots$ ,number_of-mini-batches do +6: Fetch mini-batch $\bar{\mathcal{X}}_{\mathrm{tr}}$ from $\mathcal{X}_{\mathrm{tr}}$ +7: Forward $\bar{\mathcal{X}}_{\mathrm{tr}}$ and get $f(\bar{\mathcal{X}}_{\mathrm{tr}})$ +8: Compute $\pmb {g}\left(\bar{\mathcal{X}}_{\mathrm{tr}}\right) = \pmb {T}\left(f(\bar{\mathcal{X}}_{\mathrm{tr}})\right)$ +9: Compute loss by (10) using $\pmb {g}(\bar{\mathcal{X}}_{\mathrm{tr}})$ +10: Update $\pmb{g}$ by $\mathcal{A}$ , which induces an update on $f$ +11: end for +12: end for +Output: $f$ + +the former method may enlarge the noise by orders of magnitude, making the learning process less robust. + +- Identifiability: calculating $T_{j}^{-1}(\bar{\eta}_{j}(\pmb{x}))$ in the former method for all $j = \{1, \dots, m\}$ induces $m$ estimates of $\eta(\pmb{x})$ , and they are usually non-identical due to the estimation error of $\bar{\eta}_{j}(\pmb{x})$ from finite samples or noisy $T_{j}(\cdot)$ , causing a new non-identifiable problem. + +Therefore, we choose to embed the estimation of $\eta(\boldsymbol{x})$ into the estimation of $\bar{\eta}_j(\boldsymbol{x})$ . More specifically, let $f(\boldsymbol{x})$ be the model output that estimates $\eta(\boldsymbol{x})$ , then we make use of the transition function $T_j(\cdot)$ and model $g_j(\boldsymbol{x}) = T_j(f(\boldsymbol{x}))$ . Based on it, we propose to learn with the following modified loss function: + +$$ +\ell (\boldsymbol {g} (\boldsymbol {x}), \bar {y}) = \ell (\boldsymbol {T} (f (\boldsymbol {x})), \bar {y}), \tag {12} +$$ + +where $T(f(\pmb{x})) = [T_1(f(\pmb{x})), \dots, T_m(f(\pmb{x}))]^\top$ . Then the corresponding risk for the surrogate task can be written as + +$$ +\begin{array}{l} R _ {\text {s u r r}} (f) = \mathbb {E} _ {(\boldsymbol {x}, \bar {y}) \sim \mathcal {D}} [ \ell (\boldsymbol {T} (f (\boldsymbol {x})), \bar {y}) ] \\ = \mathbb {E} _ {(\boldsymbol {x}, \bar {\boldsymbol {y}}) \sim \mathcal {D}} [ \ell (\boldsymbol {g} (\boldsymbol {x}), \bar {\boldsymbol {y}}) ] = R _ {\text {s u r r}} (\boldsymbol {g}), \tag {13} \\ \end{array} +$$ + +and an equivalent expression of the empirical risk (10) is given by + +$$ +\widehat {R} _ {\text {s u r r}} (f) = \frac {1}{n _ {\mathrm {t r}}} \sum_ {i = 1} ^ {n _ {\mathrm {t r}}} \ell (\boldsymbol {T} (\boldsymbol {f} (\boldsymbol {x} _ {i})), \bar {y} _ {i}). \tag {14} +$$ + +In order to prove that this method is classifier-consistent, we introduce the following lemma. + +Lemma 3. Let $\bar{\eta} (\pmb {x}) = [\bar{\eta}_1(\pmb {x}),\dots ,\bar{\eta}_m(\pmb {x})]^{\top}$ and $\pmb{g}^{\star}(\pmb {x}) =$ argmin $gR_{\mathrm{sur}}(g;\ell)$ be the optimal classifier of (9). Provided that a proper loss function, e.g., the cross-entropy loss or mean squared error, is chosen for $\ell$ we have $\pmb{g}^{\star}(\pmb {x}) = \bar{\eta} (\pmb {x})$ + +![](images/5e9b90ed39e4e6165dde8382b71d97fd7802ca7cc698d2e7a00523b9cfff6780.jpg) +Figure 1. Implementation diagram of $\mathbf{U}^m$ -SSC. + +Since $\pmb{g}(\pmb{x}) = \pmb{T}(f(\pmb{x}))$ and $\pmb{T}(\cdot)$ is deterministic, when considering minimizing $R_{\mathrm{surr}}(f)$ that takes $f$ as the argument, we can prove the following classifier-consistency. + +Theorem 4 (Identification of the optimal binary classifier). Assume that the cross-entropy loss or mean squared error is used for $\ell$ and $\ell_{\mathrm{b}}$ , and the model $\mathcal{G}$ used for learning $\pmb{g}$ is very flexible, e.g., deep neural networks, so that $\pmb{g}^{\star} \in \mathcal{G}$ . Let $f_{\mathrm{surr}}^{\star}$ be the $U^{m}$ -SSC optimal classifier induced by $\pmb{g}^{\star}$ , and $f^{\star} = \operatorname*{argmin}_{f} R(f; \ell_{\mathrm{b}})$ be the optimal classifier of (1), we have $f_{\mathrm{surr}}^{\star} = f^{\star}$ . + +So far, we have proved that the optimal classifier for the original binary classification task can be identified by the $\mathbf{U}^m$ -SSC learning scheme. Its algorithm is described in Algorithm 1 and its implementation is illustrated in Figure 1. + +We implement $T(\cdot)$ by adding a transition layer following the sigmoid function of the neural network (NN). At the training phase, a sample $(\pmb{x}_{\mathrm{tr}},\bar{y}_{\mathrm{tr}})$ is fetched to the network. A sigmoid function $f_{\mathrm{sig}}(x) = \frac{1}{1 + e^{-x}}$ is used to map the output of NN to the range [0, 1] such that the output $f(x)$ is an estimate of $\eta (x)$ . Then $f(x)$ is forwarded to the transition layer and a vector output $g(\pmb {x}) = T(f(\pmb {x}))$ is obtained. The loss computed on the output $g(x)$ and the surrogate label $\bar{y}_{\mathrm{tr}}$ by (10) is then used for updating the NN weights $w$ . Note that the transition layer is fixed and only the weights in the base network are learnable. At the test phase, for any test sample $x_{\mathrm{te}}$ , we compute $f(x_{\mathrm{te}})$ using only the trained base network and sigmoid function. The test sample is classified by using the sign function, i.e., $\mathrm{sign}(f(x_{\mathrm{te}}) - \frac{1}{2})$ . Our proposed method is model-agnostic and can be easily trained with a stochastic optimization algorithm, which ensures its scalability to large-scale datasets. + +# 3.4. Theoretical Analysis + +In what follows, we upper-bound the estimation error of our proposed method. Let $\hat{f}_{\mathrm{surf}} = \operatorname{argmin}_{f\in \mathcal{F}}\widehat{R}_{\mathrm{surf}}(f)$ be our empirical classifier, where $\mathcal{F} = \{f:\mathcal{X}\to \mathbb{R}\}$ is a class of measurable functions, and $f_{\mathrm{surf}}^{\star} = \operatorname{argmin}_{f\in \mathcal{F}}R_{\mathrm{surf}}(f)$ be the optimal classifier, the estimation error is defined as the gap between the risk of $\hat{f}_{\mathrm{surf}}$ and that of $f_{\mathrm{surf}}^{\star}$ , i.e., $R_{\mathrm{surf}}(\hat{f}_{\mathrm{surf}}) - R_{\mathrm{surf}}(f_{\mathrm{surf}}^{\star})$ . To derive the estimation error bound, we firstly investigate the Lipschitz continuity of the transition function $\pmb{T}(f(\pmb{x}))$ . + +Table 2. Specification of datasets and corresponding models. + +
Dataset# Train# Test# FeaturesπDModel
MNIST (LeCun et al., 1998)60,00010,0007840.495-layer MLP
Fashion-MNIST (Xiao et al., 2017)60,00010,0007840.85-layer MLP
Kuzushiji-MNIST (Clanuwat et al., 2018)60,00010,0007840.35-layer MLP
CIFAR-10 (Krizhevsky, 2009)50,00010,0003,0720.7ResNet-32
+ +Lemma 5. Assume that among the $m$ sets of $U$ data, at least two of them are different, i.e., $\exists j,j^{\prime}\in \{1,\ldots ,m\}$ such that $j\neq j^{\prime}$ and $\pi_j\neq \pi_{j'}$ , and $0\leq f(\pmb {x})\leq 1,\forall x\in \mathcal{X}$ e.g., $f(x)$ is mapped to [0,1] by the sigmoid function. Then, $\forall j = 1,\dots ,m$ , the function $T_{j}(f(\pmb {x}))$ is Lipschitz continuous w.r.t. $f(\pmb {x})$ with a Lipschitz constant $2 / \alpha^{2}$ , where + +$$ +\alpha = \min \left(\sum_ {j = 1} ^ {m} \rho_ {j} \pi_ {j} (1 - \pi_ {\mathcal {D}}), \sum_ {j = 1} ^ {m} \rho_ {j} \pi_ {\mathcal {D}} (1 - \pi_ {j})\right). +$$ + +Then we analyze the estimation error as follows. + +Theorem 6 (Estimation error bound). Assume that the loss $\ell(T(f), \bar{y})$ is upper-bounded by $M_{\ell}$ and is $\mathcal{L}_{\ell}$ -Lipschitz continuous w.r.t. $\pmb{T}(f)$ . Let $\Re_{n_{\mathrm{tr}}}(\mathcal{F})$ be the Rademacher complexity of $\mathcal{F}$ (Mohri et al., 2012; Shalev-Shwartz & Ben-David, 2014). Then, for any $\delta > 0$ , we have with probability at least $1 - \delta$ , + +$$ +\begin{array}{l} R _ {\mathrm {s u r r}} (\hat {f} _ {\mathrm {s u r r}}) - R _ {\mathrm {s u r r}} (f _ {\mathrm {s u r r}} ^ {\star}) \leq \\ \frac {8 \sqrt {2} m \mathcal {L} _ {\ell}}{\alpha^ {2}} \Re_ {n _ {\mathrm {t r}}} (\mathcal {F}) + 2 M _ {\ell} \sqrt {\frac {\ln (2 / \delta)}{2 n _ {\mathrm {t r}}}}. \tag {15} \\ \end{array} +$$ + +Theorem 6 demonstrates that as the number of training samples goes to infinity, the risk of $\hat{f}_{\mathrm{surr}}$ converges to the risk of $f_{\mathrm{surr}}^{\star}$ , since $\Re_{n_{\mathrm{tr}}}(\mathcal{F}) \to 0$ for all parametric models with a bounded norm. Moreover, the coefficient $\alpha$ implies that a tighter error bound could be obtained when the class priors $\pi_j$ are close to 0 or 1. This conclusion agrees with our intuition that purer U sets (containing almost only positive/ negative examples) lead to better performance. + +# 4. Experiments + +In this section, we experimentally analyze the proposed method and compare it with state-of-the-art methods in the $\mathrm{U}^m$ classification setting. + +Datasets We train on widely adopted benchmarks MNIST, Fashion-MNIST, Kuzushiji-MNIST, and CIFAR-10. Table 2 briefly summarizes the benchmark datasets. Since the four datasets contain 10 classes originally, we manually corrupt + +them into binary classification datasets. More details about the datasets are in Appendix B.1. + +In the experiments, unless otherwise specified, the number of training data contained in all U sets are the same and fixed as $n_j = n_{\mathrm{tr}} / m$ for all benchmark datasets; and the class priors $\{\pi_j\}_{j=1}^m$ of all U sets are randomly sampled from the range [0.1, 0.9] under the constraint that the sampled class priors are not all identical, ensuring that the problem is mathematically solvable. Given $\{n_j\}_{j=1}^m$ and $\{\pi_j\}_{j=1}^m$ , we generate $m$ sets of U training data following (4). Note that in most LLP papers, each U set is uniformly sampled from the shuffled U training data, therefore the label proportions of all the U sets are the same in expectation. As the set size increases, all the proportions converge to the same class prior, making the LLP problem computationally intractable (Scott & Zhang, 2020). As shown above, our experimental scheme avoids this issue by determining valid class priors before sampling each U set. + +Models The models are optimizers used are also described in Table 2, where MLP refers to multi-layer perceptron, ResNet refers to residual networks (He et al., 2016), and their detailed architectures are in Appendix B.2. As a common practice, we use Adam (Kingma & Ba, 2015) with the cross-entropy loss for optimization. We train 300 epochs for all the experiments, and the classification error rates at the test phase are reported. All the experiments are repeated 3 times and the mean values with standard deviations are recorded for each method. + +Baselines We compare the proposed method with state-of-the-art methods based on the classification risk (Scott & Zhang, 2020) and the empirical proportion risk (Tsai & Lin, 2020) for the $\mathbf{U}^m$ classification problem. Recall that the proposed learning objective $\widehat{R}_{\mathrm{U}^{\mathrm{m}}}(f)$ in Scott & Zhang (2020) is a combination of the unbiased balanced risk estimators $\widehat{R}_{\mathrm{U}^{2 - \mathrm{b}}}(f)$ , which are shown to underperform the unbiased risk estimator $\widehat{R}_{\mathrm{U}^2}(f)$ in Lu et al. (2019). So we improve the baseline method of Scott & Zhang (2020) by combining $\widehat{R}_{\mathrm{U}^2}(f)$ instead of $\widehat{R}_{\mathrm{U}^{2 - \mathrm{b}}}(f)$ . As shown in Lu et al. (2020), the empirical risks $\widehat{R}_{\mathrm{U}^2}(f)$ can go negative during training which may cause overfitting, so we further improve the baseline by combining the corrected non-negative risk estimators $\widehat{R}_{\mathrm{U}^{2 - \mathrm{c}}}(f)$ . The baselines are summarized as follows: + +![](images/caa7c6b9a66077d5da025aa87585833ff1184cde6cd3779c966c8a2d81fde39f.jpg) +Figure 2. Experimental results of learning from 10 and 50 sets of U data. Solid curves are the test errors (in percentage) and dashed curves are the empirical training risks. Dark colors show the mean errors (risks) of 3 trials and light colors show the standard deviations. + +![](images/8a1fada5ded36fa2ddb669fbad77b1bd4dd2186d3ef691effac29927aa3d15f3.jpg) +Figure 3. Box plot of the classification errors for the proposed $\mathbf{U}^m$ -SSC method tested on learning from $50~\mathrm{U}$ sets with inaccurate class priors ( $\epsilon = 0$ means true; larger $\epsilon$ , larger noise). + +![](images/ccf3d557266e9f2143e3b5b0857f16eebdcc6d178be412f97de0fb1d0842bd51.jpg) + +![](images/76d5d95ab89b8491ef857178f1d123b494a34914ad6acfcb2c6d15b01d938df7.jpg) + +![](images/647c8317bd7252300d48d4ff5186a05345f923341000a6f593c4f546e44460f7.jpg) + +Table 3. Mean errors (standard deviations) over 3 trials in percentage for the proposed $\mathrm{U}^m$ -SSC method tested on different set sizes. The uniform set size $n_j$ is shifted to $\tau \cdot n_j$ (smaller $\tau$ , larger shift). Random means uniformly sample a set size from range $[0, T]$ . + +
DatasetSetsnjτ = 0.8τ = 0.6τ = 0.4τ = 0.2Random
MNIST1060002.83 (0.18)2.91 (0.04)3.2 (0.2)3.19 (0.35)2.66 (0.08)
5012002.46 (0.1)2.58 (0.08)2.76 (0.13)2.97 (0.11)3.0 (0.12)
Fashion-MNIST1060007.88 (0.21)7.68 (0.36)7.84(0.17)7.89 (0.24)7.04 (0.13)
5012008.29 (0.19)8.91 (0.29)7.61 (0.55)8.8 (0.31)8.62 (0.24)
Kuzushiji-MNIST1060008.98 (0.52)9.83 (0.57)9.43 (0.41)10.03 (0.81)8.38 (0.31)
5012009.35 (0.33)9.53 (0.64)9.89 (0.72)11.08 (0.61)10.34 (0.73)
CIFAR-1010500012.55 (0.61)12.25 (0.8)12.41 (0.35)12.49 (0.98)11.65 (0.44)
50100012.16 (0.23)12.19 (0.75)12.88 (0.37)13.66 (0.54)12.09 (0.42)
+ +- MMC- $\mathbf{U}^2$ -b (Scott & Zhang, 2020): the classification risk based method in the multiple mutual contamination (MMC) framework, i.e., (8); +- MMC-U $^2$ : the method that improves MMC-U $^2$ -b with unbiased risk estimators $\widehat{R}_{\mathrm{U}^2}(f)$ ; +- MMC- $\mathrm{U}^2$ -c: the method that improves MMC- $\mathrm{U}^2$ with non-negative risk correction $\widehat{R}_{\mathrm{U}^2 -\mathrm{c}}(f)$ ; +- LLP-VAT (Tsai & Lin, 2020): the empirical proportion risk based method, i.e., (6). + +More details about the implementation of baselines can be found in Appendix B.3. + +# 4.1. Comparison with State-of-the-art Methods + +We first compare our proposed method with state-of-the-art methods for the $\mathrm{U}^m$ classification problem. The experimental results of learning from 10 and $50\mathrm{U}$ sets are reported in Figure 2 and a table of the final errors is in Appendix C.1. + +We can see that the classification risk based methods, i.e., MMC- $\mathrm{U}^2$ -b, MMC- $\mathrm{U}^2$ , MMC- $\mathrm{U}^2$ -c, and our proposed $\mathbf{U}^{m}$ SSC method generally outperform the empirical proportion risk based method, i.e., LLP-VAT, with lower classification error and more stability, which demonstrates the superiority of the consistent methods. + +Within the classification risk based methods, our observations are as follows. First, the proposed $\mathrm{U}^m$ -SSC method outperforms others in most cases. We believe that the advantage comes from the surrogate set classification mechanism + +in $\mathrm{U}^m$ -SSC, which implies the classifier-consistent methods perform better than the risk-consistent methods. Second, compared to MMC- $\mathrm{U}^2$ -b, we can see our advantage becomes bigger when $\pi_{\mathcal{D}} \approx \frac{1}{2}$ is not the case, e.g., Fashion-MNIST and CIFAR-10. Moreover, the performance of the improved MMC- $\mathrm{U}^2$ method (combination of unbiased risk estimators) is better than MMC- $\mathrm{U}^2$ -b (combination of balanced risk estimators) in all cases. These empirical findings corroborate our analysis that the balanced classification risk (7) can be biased in such cases. Third, we confirm that the training risks of MMC- $\mathrm{U}^2$ -b and MMC- $\mathrm{U}^2$ go negative as training proceeds, which incurs overfitting. Other methods do not have this negative empirical training risk issue. And we can see that the improved MMC- $\mathrm{U}^2$ -c method effectively mitigates this overfitting but its performance is still inferior to our proposed method. These results are consistent with the observations in Lu et al. (2020). We also notice that the empirical training risks of the proposed $\mathrm{U}^m$ -SSC method are obviously higher than other baseline methods. This is due to the fact that the added transition layer rescales the range of model output. We provide a detailed analysis on this point in Appendix C.1. A notable effect is that a relatively small learning rate is more suitable for our method. + +# 4.2. On the Variation of Set Size + +In practice, the size of the U sets may vary from a large range depends on different tasks. However, as the set size varies, given the data generation process in (3), the marginal density of our training data $p_{\mathrm{tr}}(\pmb{x})$ shifts from that of the test one, + +Table 4. Mean test errors (standard deviations) over 3 trials in percentage for the ${\mathrm{U}}^{m}$ -SSC method tested with different set numbers. + +
Dataset2 sets100 sets500 sets1000 sets
MNIST2.362.593.072.84
(0.27)(0.11)(0.14)(0.16)
Fashion-MNIST7.958.618.508.64
(0.85)(0.43)(0.44)(0.26)
Kuzushiji-MNIST9.6810.2011.6410.68
(0.96)(0.50)(0.54)(0.40)
CIFAR-1013.2113.3012.9813.16
(1.26)(0.65)(0.37)(0.70)
+ +which may cause severe covariate shift (Shimodaira, 2000; Zhang et al., 2020). To verify the robustness of our proposed method against covariate shift, we conducted experiments on the variation of set size. Recall that in other experiments, we use uniform set size, i.e., all sets contain $n_{\mathrm{tr}} / m$ U data. In this subsection, we investigate two kinds of set size shift: + +- Randomly select $\lceil m / 2\rceil$ U sets and change their set sizes to $\tau \cdot n_{\mathrm{tr}} / m$ where $\tau \in [0,1]$ +- Randomly sample each set size $n_j$ from range $[0, n_{\mathrm{tr}}]$ such that $\sum_{j=1}^{m} n_j = n_{\mathrm{tr}}$ . + +As shown in Table 3, the proposed method is reasonably robust as $\tau$ moves towards 0 in the first shift setting. The slight performance degradation may come from the decreased total number of training samples $n_{\mathrm{tr}}$ as $\tau$ decreases. We also find that our method reaches the best performance in 3 out of 4 benchmark datasets in the second shift setting. Since it is a more natural way for generating set sizes, the robustness of the proposed method on varied set sizes can be verified. + +# 4.3. On the Variation of Set Numbers + +Another main factor that may affect the performance is the number of available U sets. As the U data can be easily collected from multiple sources, the learning algorithm is expected to be able to handle the variation of set numbers well. The experimental results of learning from 10 and $50\mathrm{U}$ sets have been shown in Section 4.1. In this subsection, we test the proposed $\mathbf{U}^m$ -SSC method on extremely small set numbers e.g., $m = 2$ , and large set numbers, e.g., $m = 1000$ . The experimental results of learning form 2, 100, 500, and $1000\mathrm{U}$ sets are reported in Table 4. + +From the results, we can see that the performance of the proposed method is reasonably well on different set numbers. In particular, a lower classification error can be observed for $m = 2$ across all 4 benchmark datasets. The better performance may come from the larger number of U data contained in a single set, i.e., $n_{\mathrm{tr}} / 2$ in this case. Since our method uses class priors as the only weak supervision, an increasing number of the sampled data within each U set guarantees a better approximation of them. These experi + +mental results demonstrate the effectiveness of the proposed method on the variation of set numbers. We note that it is a clear advantage over the LLP methods, whose performance drops significantly when the set number becomes small and set size becomes large, because label proportions converge to the same class prior in their setup, making the LLP problem computationally intractable. + +# 4.4. Robustness against Inaccurate Class Priors + +Hitherto, we have assumed that the values of class priors $\{\pi_j\}_{j = 1}^m$ are accessible and accurately used in the construction of our method, which may not be true in practice. In order to simulate $\mathrm{U}^m$ classification in the wild, where we may suffer some errors from estimating the class priors, we design experiments that add noise to the true class priors. More specifically, we test the $\mathrm{U}^m$ -SSC method by replacing $\pi_{j}$ with the noisy $\pi_j^\prime = \pi_j + \gamma \cdot \epsilon$ , where $\gamma$ uniform randomly take values in $\{+1, - 1\}$ and $\epsilon \in \{0,0.05,0.1,0.15,0.2\}$ so that the method would treat noisy $\pi_j^\prime$ as the true $\pi_{j}$ during the whole learning process. The experimental setup is exactly same as before except the replacement of $\pi_{j}$ . Note that we tailor the noisy $\pi_{j}$ to [0, 1] if it surpasses the range. + +The results on learning from $50\mathrm{U}$ sets with inaccurate class priors are reported in Figure 3 and a table of the final test errors is in Appendix C.2, where $\epsilon = 0$ means true class priors. We can see that our method works reasonably well using noisy $\pi_j^{\prime}$ , though the classification error slightly increases for higher noise level $\epsilon$ which is as expected. + +# 5. Conclusions + +In this work, we focused on learning from multiple sets of U data and proposed a new method based on a surrogate set classification task. We bridged the original and surrogate class-posterior probabilities via a linear-fractional transformation, and then studied its properties. Based on them, we proposed the $\mathrm{U}^m$ -SSC algorithm and implemented it by adding a transition layer to the neural network. We also proved that the $\mathrm{U}^m$ -SSC method is classifier-consistent and established an estimation error bound for it. Extensive experiments demonstrated that the proposed method could successfully train binary classifiers from multiple U sets, and it compared favorably with state-of-the-art methods. + +# ACKNOWLEDGMENTS + +The authors would like to thank Tianyi Zhang, Wenkai Xu, Nontawat Charoenphakdee, and Yuting Tang for helpful discussions. NL was supported by the MEXT scholarship No. 171536 and MSRA D-CORE Program. GN and MS were supported by JST AIP Acceleration Research Grant Number JPMJCR20U3, Japan. MS was also supported by the Institute for AI and Beyond, UTokyo. + +# References + +Allen, D. M. Mean square error of prediction as a criterion for selecting variables. Technometrics, 13(3):469-475, 1971. +Ardehaly, E. M. and Culotta, A. Mining the demographics of political sentiment from twitter using learning from label proportions. In ICDM, 2017. +Bao, H., Niu, G., and Sugiyama, M. Classification from pairwise similarity and unlabeled data. In ICML, 2018. +Bartlett, P. L., Jordan, M. I., and McAuliffe, J. D. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138-156, 2006. +Ben-David, S., Eiron, N., and Long, P. On the difficulty of approximately maximizing agreements. Journal of Computer and System Sciences, 66(3):496-514, 2003. +Bertsekas, D. P. Nonlinear programming. Journal of the Operational Research Society, 48(3):334-334, 1997. +Brodersen, K. H., Ong, C. S., Stephan, K. E., and Buhmann, J. M. The balanced accuracy and its posterior distribution. In ICPR, 2010. +Clanuwat, T., Bober-Irizar, M., Kitamoto, A., Lamb, A., Yamamoto, K., and Ha, D. Deep learning for classical japanese literature. arXiv preprint arXiv:1812.01718, 2018. +Cour, T., Sapp, B., and Taskar, B. Learning from partial labels. Journal of Machine Learning Research, 12:1501-1536, 2011. +Croft, J. B., Wheaton, A. G., Liu, Y., Xu, F., Lu, H., Matthews, K. A., Cunningham, T. J., Wang, Y., and Holt, J. B. Urban-rural county and state differences in chronic obstructive pulmonary disease—United States, 2015. Morbidity and Mortality Weekly Report, 67(7):205, 2018. +De Boer, P.-T., Kroese, D. P., Mannor, S., and Rubinstein, R. Y. A tutorial on the cross-entropy method. Annals of operations research, 134(1):19-67, 2005. +Edmonds, J. Maximum matching and a polyhedron with 0, 1-vertices. Journal of research of the National Bureau of Standards B, 69(125-130):55-56, 1965. +Edmonds, J. and Karp, R. M. Theoretical improvements in algorithmic efficiency for network flow problems. Journal of the ACM (JACM), 19(2):248-264, 1972. +Fang, T., Lu, N., Niu, G., and Sugiyama, M. Rethinking importance weighting for deep learning under distribution shift. In NeurIPS, 2020. + +Feng, L., Lv, J., Han, B., Xu, M., Niu, G., Geng, X., An, B., and Sugiyama, M. Provably consistent partial-label learning. In NeurIPS, 2020. +Feng, L., Shu, S., Lu, N., Han, B., Xu, M., Niu, G., An, B., and Sugiyama, M. Pointwise binary classification with pairwise confidence comparisons. In ICML, 2021. +Gomes, R., Krause, A., and Perona, P. Discriminative clustering by regularized information maximization. In NeurIPS, 2010. +Goodfellow, I., Bengio, Y., and Courville, A. Deep Learning. MIT Press, 2016. +Han, B., Yao, Q., Yu, X., Niu, G., Xu, M., Hu, W., Tsang, I., and Sugiyama, M. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, 2018. +Han, B., Niu, G., Yu, X., Yao, Q., Xu, M., Tsang, I., and Sugiyama, M. Sigma: Forgetting may make learning with noisy labels more robust. In ICML, 2020. +He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In CVPR, 2016. +Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. +Ishida, T., Niu, G., Hu, W., and Sugiyama, M. Learning from complementary labels. In NeurIPS, 2017. +Ishida, T., Niu, G., Menon, A. K., and Sugiyama, M. Complementary-label learning for arbitrary losses and models. In ICML, 2019. +Jain, S., White, M., and Radivojac, P. Estimating the class prior and posterior from noisy positives and unlabeled data. In NeurIPS, pp. 2693-2701, 2016. +Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +Kingma, D. P. and Ba, J. L. Adam: A method for stochastic optimization. In ICLR, 2015. +Krizhevsky, A. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +Liu, T. and Tao, D. Classification with noisy labels by importance reweighting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(3):447-461, 2016. + +Lu, N., Niu, G., Menon, A. K., and Sugiyama, M. On the minimal supervision for training any binary classifier from only unlabeled data. In ICLR, 2019. +Lu, N., Zhang, T., Niu, G., and Sugiyama, M. Mitigating overfitting in supervised classification from two unlabeled datasets: A consistent risk correction approach. In AISTATS, 2020. +Lv, J., Xu, M., Feng, L., Niu, G., Geng, X., and Sugiyama, M. Progressive identification of true labels for partial-label learning. In International Conference on Machine Learning, 2020. +Maurer, A. A vector-contraction inequality for rademacher complexities. In ALT, pp. 3-17. Springer, 2016. +McDiarmid, C. On the method of bounded differences. Surveys in combinatorics, 141(1):148-188, 1989. +Menon, A. K., van Rooyen, B., Ong, C. S., and Williamson, R. C. Learning from corrupted binary labels via class-probability estimation. In ICML, 2015. +Mohri, M., Rostamizadeh, A., and Talwalkar, A. Foundations of Machine Learning. MIT Press, 2012. +Nair, V. and Hinton, G. E. Rectified linear units improve restricted boltzmann machines. In ICML, 2010. +Natarajan, N., Dhillon, I. S., Ravikumar, P., and Tewari, A. Learning with noisy labels. In NeurIPS, 2013. +Newman, B. Integrity and presidential approval, 1980-2000. Public Opinion Quarterly, 67(3):335-367, 2003. +Patrini, G., Rozza, A., Menon, A. K., Nock, R., and Qu, L. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, 2017. +Quadrianto, N., Smola, A. J., Caetano, T. S., and Le, Q. V. Estimating labels from label proportions. Journal of Machine Learning Research, 10:2349-2374, 2009. +Scott, C. and Zhang, J. Learning from label proportions: A mutual contamination framework. In NeurIPS, 2020. +Scott, C., Blanchard, G., and Handy, G. Classification with asymmetric label noise: Consistency and maximal denoising. In $COLT$ , 2013. +Shalev-Shwartz, S. and Ben-David, S. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. +Shimodaira, H. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference, 90(2):227-244, 2000. + +Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929-1958, 2014. +Tokunaga, H., Iwana, B. K., Teramoto, Y., Yoshizawa, A., and Bise, R. Negative pseudo labeling using class proportion for semantic segmentation in pathology. In ECCV, 2020. +Tsai, K.-H. and Lin, H.-T. Learning from label proportions with consistency regularization. In ACML, 2020. +Van Rooyen, B. and Williamson, R. C. A theory of learning with corrupted labels. Journal of Machine Learning Research, 18(1):8501-8550, 2018. +Vapnik, V. N. Statistical Learning Theory. John Wiley & Sons, 1998. +Xia, X., Liu, T., Han, B., Wang, N., Gong, M., Liu, H., Niu, G., Tao, D., and Sugiyama, M. Part-dependent label noise: Towards instance-dependent label noise. In NeurIPS, 2020. +Xiao, H., Rasul, K., and Vollgraf, R. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. +Xu, L., Neufeld, J., Larson, B., and Schuurmans, D. Maximum margin clustering. In NeurIPS, 2004. +Xu, L., Honda, J., Niu, G., and Sugiyama, M. Uncoupled regression from pairwise comparison data. In NeurIPS, 2019. +Yao, Y., Liu, T., Han, B., Gong, M., Deng, J., Niu, G., and Sugiyama, M. Dual t: Reducing estimation error for transition matrix in label-noise learning. In NeurIPS, 2020. +Yu, F. X., Choromanski, K., Kumar, S., Jebara, T., and Chang, S.-F. On learning from label proportions. arXiv preprint arXiv:1402.5902, 2014. +Zhang, T., Yamane, I., Lu, N., and Sugiyama, M. A one-step approach to covariate shift adaptation. In ACML, 2020. +Zhou, Z. A brief introduction to weakly supervised learning. National science review, 5(1):44-53, 2018. \ No newline at end of file diff --git a/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/images.zip b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6a86cafd58d55264a3f2ffdbaa2f23fcdfd14cef --- /dev/null +++ b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99a5f392294db4f200bb20f57e671dc7938acab573c5aaf0f543d10f7b481d63 +size 578664 diff --git a/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/layout.json b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7cf828f29737b56f1d67c69faa62ff34af84cac3 --- /dev/null +++ b/binaryclassificationfrommultipleunlabeleddatasetsviasurrogatesetclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:529872017158e278ccdbaaf34dc76f402d66eef0da354e41453519afb1aecece +size 681489 diff --git a/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_content_list.json b/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c7cf875e36961b285825c4d4fd2bc4039d02b487 --- /dev/null +++ b/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5c4c2a2fa638ca690a00731dc0e451542b9dc1778f5a6c1f001ed876fa07cbc +size 81015 diff --git a/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_model.json b/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5bc574e6ef03699bf33701e4fdce1826121154d1 --- /dev/null +++ b/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a825bab845c60c3d766bec2a990ea40bfd4d32b6ee53565c335c7257b2c86ad +size 94559 diff --git a/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_origin.pdf b/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e9d2155ddfc457efcbd29b45e5b579864bbfb97d --- /dev/null +++ b/blackboxdensityfunctionestimationusingrecursivepartitioning/0a9584b5-70c6-4856-9995-fc6ca5feb1a9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d027a34c201c4c565d5062c3b8bc331d8f47b555f1df0e53aa8a1718e3883b0 +size 2690979 diff --git a/blackboxdensityfunctionestimationusingrecursivepartitioning/full.md b/blackboxdensityfunctionestimationusingrecursivepartitioning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7184b1bb5b4a637be3cca392f5c11e43265f37ef --- /dev/null +++ b/blackboxdensityfunctionestimationusingrecursivepartitioning/full.md @@ -0,0 +1,297 @@ +# Black-box density function estimation using recursive partitioning + +Erik Bodin1 Zhenwen Dai2 Neill D. F. Campbell3 Carl Henrik Ek4 + +# Abstract + +We present a novel approach to Bayesian inference and general Bayesian computation that is defined through a sequential decision loop. Our method defines a recursive partitioning of the sample space. It neither relies on gradients nor requires any problem-specific tuning, and is asymptotically exact for any density function with a bounded domain. The output is an approximation to the whole density function including the normalisation constant, via partitions organised in efficient data structures. Such approximations may be used for evidence estimation or fast posterior sampling, but also as building blocks to treat a larger class of estimation problems. The algorithm shows competitive performance to recent state-of-the-art methods on synthetic and real-world problems including parameter inference for gravitational-wave physics. + +# 1. Introduction + +Bayesian methods require the computation of posterior densities, expectations, and model evidence. In all but the simplest conjugate models, these calculations are intractable and require numerical approximations to be made. In many application areas, multiple computational tasks are carried out on the same distribution or model of interest. Using traditional methods, this typically involves specialised algorithms and expertise for different tasks, reducing ease-of-use of the overall methodology, and there is often a need for many expensive computations. The individual computations can have low utilisation of past results, increasing the total computational burden and slowing down experimentation. + +The shared object on which the methods and computations operate is a density function, typically being an unnormalised joint distribution of parameters and fixed data. What + +1University of Bristol, United Kingdom 2Spotify, United Kingdom 3University of Bath, United Kingdom 4University of Cambridge, United Kingdom. Correspondence to: Erik Bodin . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +is preventing tractable computations is that the density function does not have an amenable functional form. An ideal functional form would allow us properties that are typically only associated with specific families of parametric distributions, such as fast proportional sampling, tractable expectations of functions, deriving conditional and marginal densities, and compute quantities like divergences. There are families of methods dedicated to approximating the density function with a function of such form. However, these methods either assume specific original functional forms, require known gradients, or can be prohibitively expensive. This is today a challenge often even for problems which are moderate in the number of random variables1, as many applications areas entail joint distributions with difficult properties. Such areas include the physical sciences, hyperparameter inference, and active learning, such as approximating distributions of inputs to functions. + +In this work, we construct approximations which are amenable for tractable computation. The approximation is a tree structure which can be computed ahead of time, and from which we can produce piecewise constant approximations amenable for respective task. We present an efficient algorithm to produce such trees, driving a recursive partitioning of the domain. The algorithm is designed for black-box settings, does not rely on gradients nor a known form, and addresses challenges such as multi-modality, discontinuous structures, and zero density regions. Our approach is asymptotically exact and has no sensitive free parameters; this leads to an algorithm that accommodates general density functions of moderate dimension, and that is easy to use. The method defines a sequential decision loop sampling the integrand, prioritising regions of high probability mass within a recursive refinement of the approximation. The decision loop has similar algorithmic efficiency as MCMC and nested sampling, with a time complexity allowing for sub-milliseconds second decision times and scalability to a large number of observations to obtain sufficient precision. It is competitive to recent state-of-the-art implementations of these methods for their individually supported tasks, whilst in contrast to these methods produce a density function approximation defined over the whole domain, useful for many down-stream tasks beyond efficient sampling and evidence estimation. This algorithm we refer to as DEnsity Function + +Estimation using Recursive partitioning or DEFER. + +![](images/0cec10152425a8645475256751f28bcb82601bf08d51c0ee57998408a3404f1e.jpg) + +![](images/591c5e8f4fdf6acd4d05d03ff30a69d47d2268b524418036ef1999472dd9ed11.jpg) +Figure 2. Shown on the left is an illustrative comparison to using standard rejection sampling for parameter inference on a Gaussian distribution in 5D, with a true scale parameter of $1/20$ and $1/100$ of the domain sides, corresponding to small and large marker sizes, respectively. The rejection methods use proposals drawn uniformly or in a Sobol sequence (Quasi-Monte Carlo), respectively. Shown on the right is a comparison to using a uniform grid for evidence estimation on the Students t-distribution in 2D, 4D, 6D, and 10D corresponding to the markers of increasing size. The true scale parameter corresponds to $1/100$ of the domain sides. Both experiments were run 20 times with uniformly sampled true means, and the Student's t-distribution has $2.5 + (D/2)$ degrees of freedom. + +![](images/bbc6033a2c01c43799b032f0b97414727cf4410e775ea16cae7aa0f9b9ac0bcc.jpg) +Figure 1. Partitions produced using DEFER, after 53, 303, 2 101, and 100 003 density function evaluations, respectively. + +![](images/daf8e9358f6154548811fc7320af59c31a21f2aa47440ce78767a06779819469.jpg) + +# 2. Background + +The need for substituting continuous distributions or processes with approximations exists in various forms in literature. For optimisation problems in economics (Tanaka & Toda, 2013; 2015; Farmer & Toda, 2017), and engineering (Nguyen-Hong et al., 2018; Ai et al., 2013) discrete approximations are often used, but these methods generally rely on knowing the parametric form (Miller III & Rice, 1983; DeVuyst & Preckel, 2007). Variational Inference (VI) (Blei et al., 2016; Hoffman et al., 2013) seeks a distribution approximation from a choice of variational family. However, VI typically requires differentiability and known gradients, which is not met in our setting. Acerbi (2018) combined VI with Bayesian Quadrature (O'Hagan, 1991) and a Gaussian Process (GP) surrogate to fit the variational distribution of an explicitly unknown distribution, and Jarvenpaa et al. (2020) uses a GP surrogate for Approximate Bayesian Computation (ABC). These methods are useful for scenarios where the unknown density function is significantly more expensive to evaluate than the predictive distribution of the GP surrogate, but this is typically not the case in the settings we address. To put these costs in perspective, evaluating the density function in the typical inference scenarios we address comes at a cost in the range of milliseconds, whilst the method in (Acerbi, 2018) takes around a second to decide where to evaluate already after a few evaluations. Furthermore, the time complexity of that method is $O(N^4)$ , whilst we need a near-linear algorithm scaling to many thousands or millions of evaluations. Our method is, e.g., suited for the inner-loop of such methods, such as inference of the hyperparameters of the Gaussian Process model these methods use. + +![](images/eb29096408f59ecb327b715743f28d75dfea94e528dcbf3915108411d15f205d.jpg) + +![](images/b3aaa39f5fc5fe153316e0b458bbb781a8e322102dde6687942b240e2efa9f98.jpg) + +Monte Carlo (MC) methods approximate expectations of functions using a finite collection of samples drawn in proportion to a distribution. But the samples collected, for example via Markov Chain Monte Carlo (Geyer, 1992), only constitute a density function approximation at the collected samples, and thus neither provide (probability) mass integral estimates, nor allow for density queries over the whole sample space $\Omega$ as we require. + +One of our method's main requirements is flexibility and the ability to handle unknown distributions with little to no specification. This requirement we can fulfil through having the property of asymptotic exactness. In other words, that the approximation tends towards the true distribution and that given enough computational budget, sufficient precision may be achieved. This is to circumvent the need to specify distribution-specific details upon the usage of the method; which would be difficult, as the (true) distribution is assumed explicitly unknown and complicated, in that it may have strong correlations, be discontinuous, multi-modal, or have zero density regions of complex shapes. + +To achieve asymptotic exactness, we take inspiration from quadrature, which is a classic approach to estimating an integral numerically over a bounded domain. These methods partition the domain and convert the integral into a weighted summation of integrands at each partition. By creating a partitioning of the full domain, quadrature methods provide asymptotic guarantees by design. Furthermore, quadrature methods can be robust to the characteristics of the function + +![](images/48bfe4ac5ffeeac6647c2e484dbbf5da40bc8084b0f6336ee524efb3b91be769.jpg) +(a) Partitioning definitions + +![](images/cfa1de59e6c93ab699f882b7398d74a723b13dcb6b68c5ae5ef5fcb499361994.jpg) +(b) Locally linear structure +Figure 3. Illustration of partition division. (a) The domain $\Omega$ is divided according to a partitioning $\Pi$ composed of partitions $\{\Omega_i\}$ with corresponding centroids $\{\pmb{\theta}_i\}$ . (b) Locally linear structure: High mass partitions $H = \{\pmb{\theta}_2, \pmb{\theta}_4\}$ define a linear subspace $\Phi_{\mathrm{linear}}$ used to find candidates for division (e.g. $\pmb{\theta}_1$ ). (c) Local neighbourhoods: High mass partitions $H = \{\pmb{\theta}_5, \pmb{\theta}_{10}\}$ define neighbourhood D-balls $\Phi_{\mathrm{balls}}$ used to find candidates for division (e.g. $\pmb{\theta}_6, \pmb{\theta}_9, \dots$ ). The density function is illustrated in blue. + +![](images/847a772270898bbc98d5820d28161b0ff283a8238dae40f6a1c7354fbd8a422a.jpg) +(c) Local neighbourhoods + +surface, such as discontinuities and zero density regions, as it is the domain partitioning that drives the asymptotic behaviour. Just as quadrature is asymptotically exact in the limit of decreasing size of the largest partition, we can similarly achieve this guarantee by ensuring the iterative partitioning algorithm will eventually divide all current partitions. The downside of the characteristic that provides the asymptotic guarantee is the curse of dimensionality (Gander & Gautschi, 2000; Smolyak, 1963; Gerstner & Griebel, 1998; Hewitt & Hoeting, 2019), where the number of partitions in a grid of fixed resolution grows exponentially with the number of dimensions. We will design the algorithm with this in mind, prioritising regions to refine into finer partitions iteratively. For a visual depiction of a partitioning, see Figure 1. This is especially important as the distribution's typical set may be concentrated to tiny regions, which would make an equidistant grid computationally infeasible. We illustrate this in Figure 2. In the figure, we also demonstrate the common lack of efficiency of using standard rejection sampling for posterior sampling, a method that otherwise provides much flexibility. The efficiency problem arises in typical realistic scenarios, where the likelihood function causes the typical set of the posterior to be concentrated to small regions. As illustrated, uninformed proposal distributions become infeasibly inefficient already in low dimension (5D in the example) when the posterior's typical set is even just moderately small. This is simply a consequence of the vast number of proposals needed on average per proposal landing in the typical set ( $\approx 10^7$ in the example). + +We are not the first to recognise that a tree-based partitioning of the whole domain has several desired properties. (McCool & Harwood, 1997) proposed using kd-trees to represent distributions, and (Lu et al., 2013) proposed using partitionings in Bayesian modelling and developed a prior distribution over partitions and a corresponding inference method. (Li et al., 2016) developed an algorithm to construct piecewise constant density function approximations from iid samples based on discrepancy. All these methods + +assume that we have samples drawn from the true distribution and wish to reconstruct the distribution. As such they address a different problem domain, one where samples are known a-priori. We do not have access to samples drawn from the distribution, but are instead provided the unnormalised density function. In our approach, we evaluate the density function as a part of an active sampling loop, where at each iteration we pick locations in the sample space for which to evaluate the density function. We will now proceed with our methodology. + +# 3. Methodology + +Let $f: \Omega \to \mathbb{R}_+$ be an explicitly unknown, unnormalised density function defined on a hyperrectangular sample space $\Omega \subset \mathbb{R}^D$ , which can be evaluated for any $\theta \in \Omega^3$ . Our goal is to construct a representation of the function that enables the tractability of downstream tasks, such as fast, constant-time proportional sampling, evidence estimation, tractable expectations of functions, deriving conditional and marginal densities, and compute quantities like divergences. A density function implies a distribution + +$$ +\mathcal {P} _ {f} (\boldsymbol {\theta}) = \frac {f (\boldsymbol {\theta})}{\int_ {\boldsymbol {\theta} \in \Omega} f (\boldsymbol {\theta}) d \boldsymbol {\theta}} = \frac {f (\boldsymbol {\theta})}{Z}, \tag {1} +$$ + +where $Z$ constitutes the unknown normalising constant. We will approximate both the function $f$ and the normalising constant $Z$ . + +Typically $f$ is formed via a joint distribution of data $\mathcal{D}$ and parameters $\theta$ , where we refer to $Z$ as the evidence and the distribution as the posterior. In other words, + +$$ +f (\boldsymbol {\theta}) := p (\mathcal {D} | \boldsymbol {\theta}) \mathcal {P} (\boldsymbol {\theta}) = Z \mathcal {P} (\boldsymbol {\theta} | \mathcal {D}), \tag {2} +$$ + +where $\mathcal{P}(\pmb {\theta})$ and $p(\mathcal{D}|\pmb {\theta})$ denotes the prior distribution and + +![](images/ca65fb2a302fc055f1fa7ab83325451b708d3551364adbeae7d4a59f1bcd01d3.jpg) +Figure 4. Robustness to characteristics in the density surface. In the upper row, a surface with heavy correlations and multi-modality is shown, and in the lower row a surface with discontinuities and a valley. The output of the methods is shown after approx. 150 (left) and 1k (right) density evaluations for the first function, to illustrate the relative inefficiency of MCMC in capturing modes. The same is shown after approx. 30 and 100k evaluations for the second function, to illustrate the early coarse approximation by DEFER as well as its asymptotic exactness in contrast to DNS. As different to the other methods, DEFER outputs a function $\hat{f}$ . + +the likelihood function, respectively. + +# 3.1. Representation of $\hat{f}$ + +The combination of two data structures will represent our approximation $\hat{f}$ . Firstly, a non-overlapping partitioning $\Pi \coloneqq \{\Omega_i\}$ of the domain $\Omega$ in an array, with an observed value of $f$ at each respective centroid $\theta_{i}$ of the corresponding partition $\Omega_{i}$ , that represents a Riemann sum over the domain with hyper-rectangular partitions of non-constant side lengths as illustrated in Figure 1 and Figure 3. An estimate of the normalisation constant over the domain or a subdomain is obtained by summation of the masses $\{V_{i}f(\theta_{i})\}$ of the partitions within, where $V_{i}$ is the volume of a partition with index $i$ . Secondly, a tree-structure in which these partitions are organised, forming a search tree over volumetric objects. Together, these data structures permit integrals to be approximated by summation as in a quadrature rule, density queries of $\theta$ or partitions by tree search, and constant-time sampling. Constant-time sampling will be achieved by the following. First, sample the index of a partition in constant-time using the alias method for categorical distributions (Kronmal & Peterson Jr, 1979), and then sample uniformly within the partition4. We will later demonstrate that, given such a representation, many quantities and constructs can be estimated within the same framework, including conditional and marginal distributions. + +# 3.2. Iterative construction requirements of $\hat{f}$ + +We now consider how to obtain a sufficiently close approximation to $f$ in an efficient manner. We address this in three ways. Firstly, we prioritise where in the domain $\Omega$ the approximation should be refined. Secondly, we allow for a large number of partitions. Lastly, we provide guar + +antees that the algorithm asymptotically approaches $f$ . In a non-overlapping space partitioning, the first requirement translates into a decision-problem over which partitions to divide at a given step in sequence. The second requirement translates into making the decisions in an efficient manner, with an algorithmic complexity that allows for fast decisions that remain fast also for a large number of partitions. And lastly, for the asymptotic behaviour, guaranteeing that all partitions will eventually be divided. + +# 4. Algorithm + +# Algorithm 1 DEFER + +Input: General density function $f$ defined over $\Omega$ with unknown normalisation constant $Z$ . + +Output: Approximation $\hat{f}$ , $\hat{Z}$ , as specified by the produced partitioning $\Pi_T$ . + +Initialize $t = 1$ and initial partitioning $\Pi_1 = \{\Omega\}$ + +repeat # makes density acquisitions at each iteration $\{\Omega_{i}\} =$ to_divide $[\Pi_t]$ + +divide each partition $\Omega_{i}$ , each one resulting in $\{\Omega_j\}$ new partitions + +add all sets of $\{\Omega_j\}$ into $\Pi_t$ + +remove the divided partitions $\{\Omega_i\}$ from $\Pi_t$ + +set $t\to t + 1$ and update data structures + +until $N_{t}\geq N_{\mathrm{max}}$ + +Given the representation and requirements, we construct the approximation through an iterative refinement procedure of the current tree-structured domain partitioning. The algorithm starts from the base case of the whole sample space being one partition, with its density evaluated at the centre. A subset of the existing partitions will be selected at each iteration to be divided further, as specified by a few criteria, which we will address later. Note that the base case will always be divided as at least one partition will always be divided at each iteration. When a partition is divided, it will + +result in new partitions according to a division procedure, where each new partition will receive an associated density by evaluating $f$ at the partition centre, except for the centre partition which will inherit it from the divided (parent) partition. The new partitions will subsequently be incorporated into a few data structures (and the divided partition will be excluded), including the tree-structured partitioning, as well as into some data structures to enable the division criteria to be efficiently checked for all partitions in subsequent iterations. The outline of the algorithm is shown in Algorithm 1. The set of current partitions at a given iteration $t$ in the sequence of decisions is denoted by $\Pi_t$ . We define $N_t := |\Pi_t|$ to be the number of partitions at iteration $t$ . At each iteration, we divide all partitions in $\Pi_t$ that meet any of three criteria, to produce an updated set of partitions $\Pi_{t+1}$ (referred to as to_divide in Algorithm 1). Note that only one criterion needs to be met for division of a given partition, and multiple partitions may be divided at each iteration. + +Partition division routine We will now describe the division routine, which is carried out on a given partition after it has been decided to be divided. A partition division entails dividing the partition into three sub-partitions with equal side-lengths for each divided dimension. The set of dimensions to divide is the set of dimensions of maximum length for the partition, following normalisation of the domain $\Omega$ to a unit hyper-cube to avoid favouring dimensions spanning a wider value range. An illustration is shown in Figure 3 (a), where the initial partition (the whole domain $\Omega$ ) was in the first iteration divided horizontally followed by vertically, and in the second iteration the centre partition was selected to be divided further, and divided horizontally. The divide order of the dimensions is the same as the descending order of the highest observed function value, in common with (Jones et al., 1993). In other words, after determining all the child partitions centroids and evaluating the density at those locations, associate each dimension with the highest density value observed along that dimension and rank the dimensions accordingly. Note that the centroid position do not depend on the dimension divide order even though the partition bounds do, allowing the function to be evaluated before the forming of the partitions. The forming of each new partition, with centroid $\theta_{j}$ , entails evaluating the true density function and storing the density value $f(\theta_{j})$ together with the partition boundaries. Note that each partition division results in a variable number of new partitions, depending on the number of dimensions being divided. + +Search-tree To form the search-tree described in Section 3, we store each partition $\Omega_{i}$ together with its associated density function observation $f(\pmb{\theta}_{i})$ in a node. When a partition is divided (see Algorithm 1), a set of child nodes is created and stored in an array within the parent node. Each partition $(\Omega_{i})$ is represented using two arrays; with the + +lower and upper bounds for each dimension, respectively. A query for the unique leaf node (and partition) that is associated with a given $\theta$ can be performed by traversing the tree from the root. This is a consequence of the partitions associated with child nodes of each non-leaf node being non-overlapping, and their union being equal to the partition of their parent. + +# 4.1. Partition division decision criteria + +We now detail the three individually sufficient criteria for division, that we denote CR1 to CR3. For the first criterion, with the aim of robustness to degeneracies in $f$ and to maintain an informed and efficient exploration, we will re-interpret (Jones et al., 1993) which proposed an approach to avoiding explicit assumptions of the Lipschitz constant in the context of global optimisation. In (Jones et al., 1993) the domain of the function to be optimised was iteratively split into finer partitions, where partitions to be divided had the maximum upper bound function value under any possible maximum rate of change (Lipschitz constant) between zero and infinity. We will translate and adapt this idea to our context of mass-based prioritisation over the whole function To ensure the guarantee of the approximation's asymptotic exactness, at least one criterion will need to be eventually fulfilled for all partitions, see Section 2. This first sufficient criterion (CR1) will fulfil this. We will also derive two complementary criteria that exploit typical density functions structures, motivated for increased sample-efficiency in handling strong correlations. + +# 4.1.1. SUFFICIENT PARTITION DIVISION CRITERION 1 + +One could imagine simply dividing the partition which currently has the largest estimated mass $V_{k}f(\theta_{k})$ , where $V_{k}$ is the volume of the partition $\Omega_{k}$ , and $f(\theta_k)$ is the associated density value evaluated at its centroid $\pmb{\theta}_{k}$ . However, this would not consider that the density at the centroid $\pmb{\theta}_{k}$ typically is less representative for the partition the larger the partition is. The purpose of this criterion will be to prioritise the division of partitions by their potential for (true) mass. An approach that may easily come to mind is to fit a function model to the density values and partition centroids to assess how the density function may behave outside the evaluated centroids. However, fitting a function model, as well as taking the function model into account, comes at a computational cost which often can dominate the cost of evaluating the density function more times. Moreover, an interpolating function model implies a function with no discontinuities, which we cannot assume in our setting. We will derive a rule that allows us to consider all partitions and density evaluations simultaneously, while carrying out decisions, in logarithmic time with respect to the number of partitions so far. Furthermore, the rule will handle discontinuities and rapidly changing surfaces and does not require + +an assumption or prior of the Lipschitz constant. + +Criterion The criterion (CR1) is the following. A partition $\Omega_{k}$ will be divided if there exists any rate-of-change constant $^5\bar{K} >0$ such that + +$$ +V _ {k} \cdot \left(f \left(\boldsymbol {\theta} _ {k}\right) + \bar {K} \frac {d _ {k}}{2}\right) \geq V _ {i} \cdot \left(f \left(\boldsymbol {\theta} _ {i}\right) + \bar {K} \frac {d _ {i}}{2}\right), \tag {3} +$$ + +$$ +\text {a n d} V _ {k} \cdot \left(f \left(\boldsymbol {\theta} _ {k}\right) + \bar {K} \frac {d _ {k}}{2}\right) \geq \beta \frac {\hat {Z}}{N _ {t} + 1}, \tag {4} +$$ + +for all $\forall i\in [1,N_t]$ , where $\hat{Z} = \sum_{k = 1}^{N_t}\hat{Z}_k = \sum_{k = 1}^{N_t}V_k$ . $f(\pmb{\theta}_k)$ is the normalising constant of the approximation, $V_{k}$ is the volume of the partition $\Omega_{k}$ , $\pmb{\theta}_{k}$ is the centroid of the partition, and $d_{k}$ is the diameter of the partition $d_{k} = \sup_{\pmb{\theta}_{i},\pmb{\theta}_{j}\in \Omega_{k}}||\pmb{\theta}_{i} - \pmb{\theta}_{j}||$ . Here, $\beta$ is a positive parameter specifying what constitutes a non-trivial amount of upper bound mass of a partition in relation to the current estimate of average mass; we fix $\beta = 1$ for all the experiments in this work. Note that $\beta$ only controls precision relative to the average partition mass contribution so far, and can in general be left at default. + +The first statement (Equation 3) is true if the partition of index $k$ has an upper bound on its true mass greater or equal to the upper bound of all the partitions under any choices of $\bar{K} > 0$ . The second statement (Equation 4) is true if the partition, under the corresponding choice of $\bar{K}$ , has an upper bound on the true mass that constitutes a non-trivial amount of mass. + +Implementation We check the first statement (Equation 3) using the following. After construction of a partition $\Omega_{j}$ , with parameters $(f(\pmb{\theta}_{j}),\pmb{\theta}_{j}\in \Omega_{i})$ , we map it to ordinate $V_{j}\cdot f(\pmb{\theta}_{j})$ and abscissa $V_{j}\cdot^{d_{j} / 2}$ in a 2D space, see Figure 5. The criterion will be fulfilled for a partition $\Omega_{k}$ if and only if its corresponding coordinate is a member of the upper-right quadrant of the convex hull (URQH) in this 2D space. + +The ordinate and abscissa of each partition is stored in a hash map of heaps, i.e. where each entry of a hash table maps to a heap (Williams, 1964) as its associated value. This data structure map is used to efficiently provide access to the maximum ordinate partition per unique abscissa at every iteration $t$ , which are kept sorted using the individual heaps, allowing fast updates. These partitions are the only ones that have corresponding coordinates that may be part of the URQH described, and the only ones that need to be a part of a convex hull calculation. The number of unique abscissas we will demonstrate is small and near constant with respect to the number of partitions. + +![](images/a884c6c5e6ccc5894d970dd4d10de312e24203735aa3faab4b22849a0a00bd0a.jpg) +Figure 5. Partitions and their associated density values are mapped to points in a 2D space for which the only partitions that can fulfil CR1 are also a member of the upper right quadrant of the convex hull, shown as the red line. Moreover, the only partitions whose points needs to be a part of the convex hull calculation are the ones that have the highest ordinate $V_{j} \cdot f(\theta_{j})$ (mass) per unique abscissa (green), shown with blue rings, which significantly reduces the needed computation. + +The second statement (Equation 4) is checked by considering the upper bound of the $\bar{K}$ that a given partition $\Omega_{k}$ used to fulfil the first statement. This would be the $\bar{K}$ that, were it any larger, would result in the right hand neighbour on the URQH having a larger upper bound of the mass $V_{i + 1} \cdot (f(\pmb{\theta}_{i + 1}) + \bar{K} \frac{d_{i + 1}}{2}) > V_{i} \cdot (f(\pmb{\theta}_{i + 1}) + \bar{K} \frac{d_{i}}{2})$ , which would violate Equation 3. In other words, we have $\bar{K}_{i}^{\mathrm{upper}} := 2 \frac{V_{i + 1} f(\pmb{\theta}_{i + 1}) - V_{i} f(\pmb{\theta}_{i})}{V_{i} d_{i} - V_{i + 1} d_{i + 1}}$ , except for the right-most member which will have positively infinite upper-bound on $\bar{K}$ . As such, statement two is fulfilled if $V_{i} \cdot (f(\pmb{\theta}_{i}) + \bar{K}_{i}^{\mathrm{upper}} \frac{d_{i}}{2}) \geq \beta \frac{\hat{Z}}{N_{t} + 1}$ is true. + +Fulfillment of asymptotic guarantee As of Equation 3 and 4, it is clear that the right-most member of URQH (RM-URQH) will always be divided as its upper bound is positively infinite. Note that this is true for any (finite) choice of $\beta$ . Furthermore, as the RM-URQH will always be among the partitions with the largest diameter, the largest diameter will asymptotically tend to zero. As a consequence, all partitions will eventually be divided, which in turn guarantees asymptotic convergence to $f$ as of a partitioning of the whole domain constitutes a Riemann sum. + +# 4.1.2. EXPLOITING CHARACTERISTICS OF DENSITY FUNCTIONS (CR2 AND CR3) + +We now add search behaviour to exploit desirable heuristics targeting both locally linear correlations and spatial proximity in $\Omega$ . + +Set of high mass partitions We define $H$ as a set of high (relative) mass partitions at the current iteration. A partition $\Omega_{j}$ will be a member of this set when + +$$ +\hat {Z} _ {j} \geq \hat {Z} _ {M} \quad \text {a n d} \quad \hat {Z} _ {j} \geq \alpha \frac {\hat {Z}}{N _ {t} + 1} \tag {5} +$$ + +subject to the constraint that $1 < |H| \leq M$ . The value $\hat{Z}_M$ is defined to be the mass of the partition of the $M^{\mathrm{th}}$ highest mass, $\hat{Z}_{*} = V_{*} \cdot f(\pmb{\theta}_{*})$ , and $\alpha$ is a positive parameter specifying what constitutes a large (outlier) mass ratio relative to the average partition. In practice, we set $M = \min(5, D)$ and fix $\alpha = 20$ for all experiments in this work6. + +CR2: Sufficient partition division criterion 2 See Figure 3 for intuition. Existing partitions with a high estimated mass, relative to other partitions, are grouped in the set $H$ and denoted with red centroids. Were we to assume (at least some) linear correlation between the centroids in $H$ , we may also assume that high mass is more likely to concentrate along an affine subspace defined by linear combinations of the centroids denoted $\Phi_{\mathrm{linear}}$ , illustrated by the maroon line. Partitions intersecting this $(|H| - 1)$ -dimensional hyperplane are candidates for division. + +Given the set $H$ of high mass partitions, we construct a finite set of representative points $\mathbf{R}_{\mathrm{linear}}$ based on the affine subspace constructed from linear combinations of the centroids of the partitions in $H$ that we denote $\Phi_{\mathrm{linear}}$ . We address the representative points in the supplement. A partition $\Omega_k$ will be divided if any point $\mathbf{r} \in \mathbf{R}_{\mathrm{linear}}$ falls within the partition. That is, the set $\{\mathbf{r} \mid \mathbf{r} \in \Omega_k, \mathbf{r} \in \mathbf{R}_{\mathrm{linear}}\}$ is not empty. + +CR3: Sufficient partition division criterion 3 We will now address the neighbourhoods of the $H$ partitions, illustrated in Figure 3. The figure shows that we consider spatial proximity to elements of $H$ through sets of D-dimensional balls $\Phi_{\mathrm{balls}}$ centred on elements of $H$ . We define $\Phi_{\mathrm{balls}}$ as the union of the interiors of $D$ -dimensional balls centred at respective centroid of the partitions $H$ . The diameter of a given $D$ -ball corresponding to partition $\Omega_j \in H$ is $\phi d_h$ , where $\phi$ is constrained to be $\phi > 1$ to guarantee that positions outside of $\Omega_j$ exist in all directions from $\theta_j$ . A given $\phi$ leads to a volume ratio $\nu$ of $\Omega_j$ relative to the ball as $\nu = V_j \cdot \Gamma(D/2 + 1) / (\sqrt{\pi} \frac{\phi d_j}{2})^D$ . In practice we fix $\phi = 1.2$ in all experiments in this work, which we found works well empirically with little to no benefit of targeted tuning. + +We take the set $H$ of high mass partitions and construct a discrete set $\mathbf{R}_{\mathrm{balls}}$ of additional representative points based on + +spatial proximity to the centroids in $H$ , denoted $\Phi_{\mathrm{balls}}$ , and check the condition analogously to CR2. + +Summary We have now addressed the criteria CR1 to CR3, describing the full algorithm Algorithm 1. The combined time complexity of a step $t$ is $\mathcal{O}(\log N_t + U\log U)$ , where $U$ is the number of unique abscissas (see Section 4.1.1). For an average number of steps proportional to $N_{T}$ this results in a total average time complexity of the algorithm as $\mathcal{O}(N_T(\log N_T + \bar{U}\log \bar{U}))$ . The space complexity (including storage of partitions) of the algorithm is linear, i.e. remains proportional to the number of observations. See the supplement for the analysis. We will show empirically that $\bar{U}$ is sufficiently small, and close to constant with respect to $N_{T}$ , leading to a fast and scalable algorithm. + +# 5. Experiments + +As discussed in Section 1, the focus of this work is to produce approximations to density functions with support over the whole sample space, which in turn can be used for a number of down-stream tasks. However, it is crucial that the presented algorithm produces approximations that have good quality whilst being computationally efficient. We will begin this section by assessing this using comparison to modern approximate inference methods, and we will later provide examples of the larger set of down-stream tasks we may use the new method for. For an ablation study of criterion (CR) 1 to 3, and further setup or problem details, see the supplement. + +We choose dynamic nested sampling (DNS) (Higson et al., 2019), slice sampling (Neal, 2003), and parallel-tempering MCMC (PTMCMC) (Ellis & van Haasteren, 2017) as the baselines because they are easy-to-use or able to handle multi-modality and work in the absence of gradient information. As of the capability of DNS to also estimate evidence, and to be robust to multi-modal and degenerate posteriors with relatively little tuning, it has the largest overlap in features with DEFER whilst being a recent and strong baseline. We will therefore make more elaborate comparisons with this method. Note, however, that DNS does not support proxy density queries, nor other still missing features to be addressed later. PTMCMC and slice sampling neither support mass integration nor proxy density queries (see Section 2), but is compared with when applicable for reference. + +# 5.1. Approximation quality and sample-efficiency + +We first test the robustness of the inference methods against challenging properties (see Figure 4) including multimodality, strong correlations, and discontinuities, on low dimensional examples that are easy to visualize. We illustrate the asymptotic guarantees of DEFER in the presence of such properties in the density surface. We also note its + +![](images/326c77a889fb5bf2a775d0b34f8d0ba649e4e15c85d1a4a7ee7ff20c6481deef.jpg) + +![](images/12048aff250f9156aba8ad70190d580e2b145e4a8540c4163548f7a0939cb8cc.jpg) + +![](images/167bef2a05470b10172ffe2b6eb177c45c1645cd55268f6bba6769e2de043e26.jpg) + +![](images/b56c4509f054723d110ba665d1da8cef92dc63edda694c67ea72372ac5506fde.jpg) + +![](images/dd6955f695a8dad8849576b399b24eb8f0bcd2b4b3d017376de1cdba0fa06c0f.jpg) +Figure 6. Upper row: Median absolute error of $\log Z$ . Lower row: Median absolute error of the entropy $H(\theta)$ . For both metrics, shaded areas are the $95\%$ CI of the median. + +![](images/31671a7ca5b000164e98b661283aaae12752295e027aebd4ad250d81de6f238f.jpg) + +![](images/7252e369bef46a84a8233fac3fd69d5c78a93cae03ac4199e5963f84e5e1cab0.jpg) + +![](images/dbe4b98fe0202c8a82e2ec41194b3e0398382328c43a4e50e00d9fdcc7b86368.jpg) + +![](images/f8772ac9585aaffbd4205ccc7d5c6a1c35a048dfa4e419b9167ef790a3aa63a4.jpg) +Figure 7. Parameter estimation for gravitational-wave physics. Shown are histograms of the two-dimensional marginals of a 6D parameter inference problem (Ashton et al., 2019), with samples produced after 5M density function evaluations. Upper row: from the DEFER approximation. Second row: using PTMCMC. Bottom row: using DNS. + +![](images/604435d23125f8da836bdafdbea96e7482bb00319d184154fe341319eea42380.jpg) +Figure 8. Time-series forecasting using Gaussian Processes with the Spectral Mixture kernel. The data is shown in black, and posterior GP samples in blue. + +sample-efficiency in representing all modes when compared to MCMC, and in capturing detail when compared to both DNS and the MCMC methods. In one of the shown examples DNS fail to recover the ground truth, which may be related to the algorithm's determination of likelihood contours (Higson et al., 2019). + +We compare with DNS quantitatively both for evidence and parameter estimation. For evidence estimation, we measure the median absolute error in log evidence (or $\log Z$ ) over 20 runs with various budgets. For parameter estimation, we measure the error in estimated differential entropy, due to lack of summary statistics for multi-modal distributions. Results for a few functions with various challenging characteristics are shown in Figure 6, such as very small or elongated typical sets (see supplement for the functions). We remind the reader that although the surface of the approximation always tends towards the true surface, integral estimates can oscillate slightly as local overestimations and underestimations can cancel out to some degree. DEFER is able to match and typically significantly surpass the performance of DNS. Especially in getting close to the solution already at low $N_{T}$ budgets, sometimes needing order of magnitudes fewer function evaluations, but it also performs better using the higher $N_{T}$ budgets. The gaps between the methods are + +noticeably larger for estimating differential entropy. Estimation of entropy is more sensitive to the matching of the shape of a distribution, and not only its integral. On Canoe, DNS completely misses the concentrated mass, but DEFER finds it after 100k evaluations, which leads to a sharp drop in the error of both evidence and differential entropy. + +# 5.2. Real-world density surfaces + +Synthetic distributions like the ones addressed are convenient to use for assessment as they have known properties. However, it is important to confirm that DEFER can be applied to real-world distributions and density functions. To do this, we will apply DEFER on a parameter estimation task from gravitational-wave (GW) physics research (Abbott et al., 2019; Collaboration et al., 2020), and a hyperparameter inference task from (Wilson & Adams, 2013). + +In GW research physically motivated likelihood functions and priors (Kalaghatgi et al., 2020) are used, often without gradients available, and the induced density surfaces are typically complicated, multi-modal, or discontinuous. Inference on these problems is often prohibitively slow, warranting actions such as re-sampling, density re-weighting and local density integration. DEFER outputs a density function + +![](images/cddbec35f14d059cdbd1c61d9174d94cd43a1cbbbf9471009403d13aa2ad3c2e.jpg) +Figure 9. Input distributions. Shown in pink are function $(f)$ samples from posterior Gaussian Processes, with hyperparameters $\pmb{\theta}$ ancestrally sampled from the posterior $\mathcal{P}(\pmb{\theta}|\mathcal{D})$ . $\mathcal{P}(x')$ represent the distribution of the input which generated $y'$ , where $y' := f(x')$ and $y' \sim \mathcal{P}(y')$ . DEFER makes it possible to derive an approximation to this input distribution by a combination of capabilities. The free-form approximation produced is flexible enough to represent the multi-modal input distribution. Furthermore, we are able to estimate the intractable integral $\mathcal{P}(x') \propto \int \mathcal{P}(y = y'|x) \mathcal{P}(x) \mathcal{P}(y') dxdy'$ for each $x' \in \mathcal{X}$ . $\mathcal{P}(x)$ is here set to be uniform over the range of the figure. + +approximation with support for all these tasks making use of the domain-indexed search tree over partitions. We apply DEFER to a simulated signal example from (Ashton et al., 2019). Figure 7 shows all the 2D marginals of a 6D problem using the 'IMRPhenomPv2' waveform approximant. Inferred parameters are, for example, the luminosity distance, and the spin magnitudes of binary black-holes. We note the complicated interactions between parameters, showing the importance of handling multi-modality and strong correlations. Importantly, DEFER is able to handle the surface well without any tuning parameters. As PTMCMC, DEFER asymptotically approaches the unknown ground truth surface. See the supplement for additional GW experiments. + +We apply DEFER to a Gaussian Process time-series regression model with a spectral mixture kernel (SMK) (Wilson & Adams, 2013) to infer the posterior of hyperparameters of the kernel, which is known to be heavily multi-modal and complicated. With a budget of $50\mathrm{k}$ function evaluations, the negative log-likelihoods on the test data are 377.66, 365.97, 236.89 and 205.50, for slice sampling, PTMCMC, DNS and DEFER, respectively. For predictions using DEFER, see Figure 8. See supplement for further details and plots. + +# 5.3. Runtime performance + +In the supplement we confirm both that DEFER has a similar algorithmic cost to the other methods and that the DEFER has a near-constant cost per function evaluation with respect to $N_{T}$ . With algorithmic cost, we refer to the cost per 'decision' of where to evaluate the density function, which is computed from the total (wall-clock) time of inference minus the total function evaluation time, divided by the number of function evaluations made. In practice, using our implementation of DEFER and setup, the decision time per + +evaluation were around 0.3 to 0.5 milliseconds also after millions of density evaluations. + +# 5.4. Down-stream task and application examples + +We are now finished with the empirical comparisons, confirming the quality of the resulting approximations and the efficiency of DEFER to construct them. Importantly, we have treated density functions in a way that lets us be agnostic to the problem giving rise to the density function. The approximation produced is a tree from which we can produce a piecewise constant function defined over the domain or any axis-aligned hyper-rectangular subdomain. This way we can transform a myriad of problems involving intractable integrals, such as density marginalisations, or deriving conditional distributions, into queries of the approximation and summation. + +For example, consider the problem of estimating mutual information $I(\pmb{\theta}_a; \pmb{\theta}_b) = \mathbb{E}_{\mathcal{P}(\pmb{\theta}_a, \pmb{\theta}_b)}[\log \frac{\mathcal{P}(\pmb{\theta}_a, \pmb{\theta}_b)}{\mathcal{P}(\pmb{\theta}_a) \mathcal{P}(\pmb{\theta}_b)}]$ . Normally this would require a specialised algorithm, but we may now instead estimate it by using DEFER to approximate the joint $\mathcal{P}(\pmb{\theta}_a, \pmb{\theta}_b)$ , and then use the capabilities of the approximation. Another example is to propagate uncertainty, such as deriving the distribution of the input to an uncertain function producing an uncertain output, see Figure 9. We may also apply DEFER to multiple distributions, allowing us to estimate divergences. + +We provide code and examples for such applications and more at https://github.com/bodin-e/defer. + +# 6. Conclusion + +We have presented a new approach to general Bayesian computation and approximate inference based on recursive partitioning. The approach is shown to be competitive to state-of-the-art methods on black-box density functions, with high sample-efficiency and scalability, allowing complicated surfaces to be estimated with high precision. The algorithm produces a function representation that can be used for a diverse set of tasks beyond the computation of evidence and sampling, and is flexible and easy to use. + +Acknowledgments We thank Virginia D'Emilio, Rhys Green and Vivien Raymond (Cardiff University) for input and useful discussions relating to gravitational-wave physics, Ivan Ustyuzhaninov (University of Tübingen) for useful input relating to the representative points, and Ieva Kazlauskaite, Vidhi Lalchand and Pierre Thodoroff (University of Cambridge) for comments that greatly improved the manuscript. Supported by the Engineering and Physical Sciences Research Council, The Royal Swedish Academy of Engineering Sciences, UKRI CAMERA project (EP/M023281/1, EP/T022523/1) and the Royal Society. + +# References + +Abbott, B., Abbott, R., Abbott, T., Abraham, S., Acernese, F., Ackley, K., Adams, C., Adhikari, R., Adya, V., Affeldt, C., et al. Gwtc-1: A gravitational-wave transient catalog of compact binary mergers observed by ligo and virgo during the first and second observing runs. Physical Review X, 9(3):031040, 2019. +Acerbi, L. Variational bayesian monte carlo. In Advances in Neural Information Processing Systems, pp. 8213-8223, 2018. +Ai, X., Wen, J., Wu, T., and Lee, W.-J. A discrete point estimate method for probabilistic load flow based on the measured data of wind power. IEEE Transactions on Industry Applications, 49(5):2244-2252, 2013. +Ashton, G., Hübner, M., Lasky, P. D., Talbot, C., Ackley, K., Biscoveanu, S., Chu, Q., Divakarla, A., Easter, P. J., Goncharov, B., et al. Bilby: A user-friendly bayesian inference library for gravitational-wave astronomy. The Astrophysical Journal Supplement Series, 241(2):27, 2019. +Blei, D. M., Kucukelbir, A., and McAuliffe, J. D. Variational inference: a review for statisticians. CoRR, 2016. URL http://arxiv.org/abs/1601.00670v9. +Collaboration, L. S., Collaboration, V., et al. Gw190412: Observation of a binary-black-hole coalescence with asymmetric masses. arXiv preprint arXiv:2004.08342, 2020. +DeVuyst, E. A. and Preckel, P. V. Gaussian cubature: A practitioners guide. Mathematical and Computer Modelling, 45(7-8):787-794, 2007. +Ellis, J. and van Haasteren, R. jellis18/ptmcmcsampler: Official release, October 2017. URL https://doi.org/10.5281/zenodo.1037579. +Farmer, L. E. and Toda, A. A. Discretizing nonlinear, nongaussian markov processes with exact conditional moments. Quantitative Economics, 8(2):651-683, 2017. +Gander, W. and Gautschi, W. Adaptive quadraturerevisited. BIT Numerical Mathematics, 40(1):84-101, 2000. +Gerstner, T. and Griebel, M. Numerical integration using sparse grids. Numerical Algorithms, 18:209-232, 1998. +Geyer, C. J. Practical markov chain monte carlo. Statistical science, pp. 473-483, 1992. +Hewitt, J. and Hoeting, J. A. Approximate bayesian inference via sparse grid quadrature evaluation for hierarchical models. CoRR, 2019. URL http://arxiv.org/abs/1904.07270v1. + +Higson, E., Handley, W., Hobson, M., and Lasenby, A. Dynamic nested sampling: an improved algorithm for parameter estimation and evidence calculation. Statistics and Computing, 29(5):891-913, 2019. +Hoffman, M. D., Blei, D. M., Wang, C., and Paisley, J. Stochastic variational inference. 14(1):1303-1347, 2013. +Jarvenpaa, M., Vehtari, A., and Marttinen, P. Batch simulations and uncertainty quantification in gaussian process surrogate approximate bayesian computation. In Conference on Uncertainty in Artificial Intelligence, pp. 779-788. PMLR, 2020. +Jones, D. R., Perttunen, C. D., and Stuckman, B. E. Lipschitzian optimization without the lipschitz constant. Journal of optimization Theory and Applications, 79(1):157-181, 1993. +Kalaghatgi, C., Hannam, M., and Raymond, V. Parameter estimation with a spinning multimode waveform model. Phys. Rev. D, 101:103004, May 2020. doi: 10.1103/PhysRevD.101.103004. URL https://link.aps.org/doi/10.1103/PhysRevD.101.103004. +Kronmal, R. A. and Peterson Jr, A. V. On the alias method for generating random variables from a discrete distribution. The American Statistician, 33(4):214-218, 1979. +Li, D., Yang, K., and Wong, W. H. Density estimation via discrepancy based adaptive sequential partition. Advances in neural information processing systems, 29:1091, 2016. +Lu, L., Jiang, H., and Wong, W. H. Multivariate density estimation by bayesian sequential partitioning. Journal of the American Statistical Association, 108(504):1402-1410, 2013. +McCool, M. D. and Harwood, P. K. Probability trees. In Graphics Interface, volume 97, pp. 37-46. CiteSeer, 1997. +Miller III, A. C. and Rice, T. R. Discrete approximations of probability distributions. Management science, 29(3): 352-362, 1983. +Neal, R. M. Slice sampling. Annals of statistics, pp. 705-741, 2003. +Nguyen-Hong, N., Nguyen-Duc, H., and Nakanishi, Y. Optimal sizing of energy storage devices in isolated wind-diesel systems considering load growth uncertainty. IEEE Transactions on Industry Applications, 54(3):1983-1991, 2018. +O'Hagan, A. Bayes-hermite quadrature. Journal of statistical planning and inference, 29(3):245-260, 1991. + +Smolyak, S. A. Quadrature and interpolation formulas for tensor products of certain classes of functions. 148:1042-1045, 1963. +Tanaka, K. and Toda, A. A. Discrete approximations of continuous distributions by maximum entropy. Economics Letters, 118(3):445-450, 2013. +Tanaka, K. and Toda, A. A. Discretizing distributions with exact moments: Error estimate and convergence analysis. + +SIAM Journal on Numerical Analysis, 53(5):2158-2177, 2015. +Williams, J. W. J. Algorithm 232: heapsort. Commun. ACM, 7:347-348, 1964. +Wilson, A. and Adams, R. Gaussian process kernels for pattern discovery and extrapolation. In International conference on machine learning, pp. 1067-1075, 2013. \ No newline at end of file diff --git a/blackboxdensityfunctionestimationusingrecursivepartitioning/images.zip b/blackboxdensityfunctionestimationusingrecursivepartitioning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7f507e3353f2803b828730f1e88aa60b4cafffc9 --- /dev/null +++ b/blackboxdensityfunctionestimationusingrecursivepartitioning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1efbc4da85a9adec8c9d3848e6cde489e36d71d327caf6eebbbb7cdf1d672d36 +size 346176 diff --git a/blackboxdensityfunctionestimationusingrecursivepartitioning/layout.json b/blackboxdensityfunctionestimationusingrecursivepartitioning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fc01aaff1dd7624cbd4b873230f8d983718dfc41 --- /dev/null +++ b/blackboxdensityfunctionestimationusingrecursivepartitioning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e47c57dd4ae9438ee419f1d804dc251a22777f1fbbc7b01a6cacdcec232a6d25 +size 457653 diff --git a/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_content_list.json b/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c0db416c77988418a2e54f2074784e35712e45bf --- /dev/null +++ b/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f76446ed3d2060507d08a20f98f9dafaeb47d5fa51db35259cd3c9267dd1929d +size 88040 diff --git a/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_model.json b/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_model.json new file mode 100644 index 0000000000000000000000000000000000000000..077ccd3f1a3cf96574588c2760509e117ff46726 --- /dev/null +++ b/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0221c34e98620dd48f9b00d7f89511dc12c3b3f839d1174e5f1d8971b556fece +size 103403 diff --git a/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_origin.pdf b/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..08b361a3d5cf027f0d1c83da5a891f8a0932f61e --- /dev/null +++ b/blindparetofairnessandsubgrouprobustness/038193c8-a2df-4fac-a007-8fb15fb5ae27_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50b5521cdfcd8880dabe61630280c1cfa6371a37b1f7de2566e7488fc9edd5b4 +size 7033664 diff --git a/blindparetofairnessandsubgrouprobustness/full.md b/blindparetofairnessandsubgrouprobustness/full.md new file mode 100644 index 0000000000000000000000000000000000000000..70fb6a39775bcfeea13b03529c9a6375a4f7f174 --- /dev/null +++ b/blindparetofairnessandsubgrouprobustness/full.md @@ -0,0 +1,374 @@ +# Blind Pareto Fairness and Subgroup Robustness + +Natalia Martinez $^{*1}$ Martin Bertran $^{*1}$ Afroditi Papadaki $^{2}$ Miguel Rodrigues $^{2}$ Guillermo Sapiro + +# Abstract + +Much of the work in the field of group fairness addresses disparities between predefined groups based on protected features such as gender, age, and race, which need to be available at train, and often also at test, time. These approaches are static and retrospective, since algorithms designed to protect groups identified a priori cannot anticipate and protect the needs of different at-risk groups in the future. In this work we analyze the space of solutions for worst-case fairness beyond demographics, and propose Blind Pareto Fairness (BPF), a method that leverages no-regret dynamics to recover a fair minimax classifier that reduces worst-case risk of any potential subgroup of sufficient size, and guarantees that the remaining population receives the best possible level of service. BPF addresses fairness beyond demographics, that is, it does not rely on predefined notions of at-risk groups, neither at train nor at test time. Our experimental results show that the proposed framework improves worst-case risk in multiple standard datasets, while simultaneously providing better levels of service for the remaining population. The code is available at github.com/natalialmg/BlindParetoFairness. + +# 1. Introduction + +A large body of literature has shown that machine learning (ML) algorithms trained to maximize average performance on existing datasets may present discriminatory behaviour across pre-defined demographic groups (Barocas & Selfbst, 2016; Hajian et al., 2016), meaning that segments of the overall population are measurably under-served by the ML model. This has sparked interest in the study on why these disparities arise, and on how they can be addressed (Mitchell et al., 2018; Chouldechova & Roth, 2018; Barocas et al., + +$^{*}$ Equal contribution $^{1}$ Duke University, Durham, NC, USA $^{2}$ University College London, London, UK. Correspondence to: Natalia Martinez , Martin Bertran . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +2019). One popular notion is group fairness, where the algorithm has access to a set of predefined demographic groups during training, and the goal is to learn a model that satisfies a certain notion of fairness across these groups (e.g., statistical parity, equality of opportunity) (Dwork et al., 2012; Hardt et al., 2016); this is usually achieved by adding a constraint to the standard optimization objective. It has been shown that optimality may be in conflict with some notions of fairness (e.g., the optimal risk is different across groups) (Kaplow & Shavell, 1999; Chen et al., 2018), and perfect fairness can, in general, only be achieved by degrading the performance on the benefited groups without improving the disadvantaged ones. This conflicts with notions of no-harm fairness such as in (Ustun et al., 2019), which are appropriate where quality of service is paramount. Notions such as minimax fairness, commonly known as Rawlsian max-min fairness from an utility maximization perspective (Rawls, 2001; 2009), combined with Pareto efficiency, naturally address this no-harm concern (Martinez et al., 2020; Diana et al., 2020). + +Recent works study fairness in ML when no information about the protected demographics is available, for example, due to privacy or legal regulations (Kallus et al., 2019). This is an important research direction and has been identified as a major industry concern (Veale & Binns, 2017; Holstein et al., 2019), since many applications and datasets in ML currently lack demographic records. We therefore study the problem of building minimax Pareto fair algorithms beyond demographics, meaning that not only we lack group membership records but also have no prior knowledge about the demographics to be considered (e.g., any subset of the population can be a valid protected group, see computationally identifiable groups (Hébert-Johnson et al., 2018)). This has the advantage of making the model robust to any potential demographic even if they are unknown at the time of design, or change through time; it is also efficient, since the model offers the best level of service to all the remaining (i.e., non-critical) population. + +Main Contributions. We analyze subgroup robustness, where a model is minimax fair w.r.t. any group of sufficient size, regardless of any preconceived notion of protected groups; we also adhere to the notion of no-harm fairness by requiring our minimax model to be Pareto efficient (Mas + +Colell et al., 1995) by providing the best level of service to the remaining population. A model with these characteristics has a performance guarantee even for unidentified protected classes. + +We show that being subgroup robust w.r.t. an unknown number of groups, where no individual group is smaller than a certain size, is mathematically equivalent in terms of worst group performance to solving a simplified two-group problem, where the population is divided into high and low risk groups, thereby providing a clear means to design "universal" minimax fair ML models. We further show the critical role of the minimum group size by proving that, for standard classification losses (cross-entropy and Brier score), there is a limit to the smallest group size we can consider before the solution degenerates to a trivial, uniform classifier, a similar result is also demonstrated for losses where there is a preferred outcome; a common scenario in fair ML. We additionally study the cost of blind subgroup robustness when compared to learning a model that is minimax fair w.r.t. predefined demographics. + +We then propose Blind Pareto Fairness (BPF), a simple learning procedure that leverages recent methods in no-regret dynamics (Chen et al., 2017) to solve subgroup robustness subject to a user-defined minimum subgroup size. Our method is provably convergent and can be used on classification and regression tasks. We experimentally evaluate our method on a variety of standard ML datasets and show that it effectively reduces worst-case risk and compares favourably with previous works in the area. Although our work is motivated by fairness, subgroup robustness has applications beyond this important problem, see for example (Sohoni et al., 2020a; Duchi et al., 2020). + +# 2. Related Work + +A body of work has addressed fairness without explicit demographics by using proxy variables to impute the protected population labels (Elliott et al., 2008; Gupta et al., 2018; Zhang, 2018). These methods contrast with our assumptions by relying on a preconceived notion on what the protected demographics are (i.e., the protected demographics are known, but unobserved), since prior knowledge is needed to design useful proxy variables. Moreover, it has been reported that these approaches can exacerbate disparities by introducing undesired bias (Chen et al., 2019; Kallus et al., 2019); aiming to be fair by inferring protected attributes may be in conflict with privacy or anonymity concerns. These works might need re-training if new protected classes are identified, since a model trained under these conditions may be considerably harmful on an unknown population. This phenomena further supports the value of blind subgroup robustness. + +Individual fairness (Dwork et al., 2012) provides guarantees beyond protected attributes, but requires predefined similarity functions which may be hard or infeasible to design for real-world tasks. The works of (Hébert-Johnson et al., 2017; Kearns et al., 2018) address fairness w.r.t. subgroups based solely on input features, and while these works greatly extend the scope of the protected demographics, they still rely on labeled protected features for guidance. The work of (Sohoni et al., 2020b) partitions the input space to address robust accuracy. We note that partitions, based only on the input space of the model do not modify the solution of risk-based Pareto optimal models, since the optimal classifier for any input value remains unchanged (i.e., there is no conflict between objectives for any value of the input space, see Theorem 4.1 in (Martinez et al., 2020)). In our work we consider subgroups based on both outcome and all input features, which broadens the scope to all conceivable subgroups based on the information available to the trainer. For many risk-based measures of utility, such as crossentropy, Brier score, or $\ell_2$ regression loss, the optimal classifier can be expressed as a function of the conditional output probability $p(Y|X)$ , $X$ being the input (features) and $Y$ the output. In particular, if we only consider groups that introduce covariate shift (i.e., $p(X|A)$ varies across different values of the group membership $A$ ) but do not change the conditional target distribution ( $p(Y|X,A) = p(Y|X)$ for all $A$ ), then the set of Pareto classifiers only contain one element and the Pareto curve degenerates to the utopia point. By specifically taking outcomes into account in our partition function, we allow for robustness to perturbations on the conditional distribution $p(Y|X,A)$ . + +There are two recent approaches that are the closest to our objective (protecting unknown and unobserved demographics). One is distributionally robust optimization (DRO) (Hashimoto et al., 2018; Duchi et al., 2020), where the goal is to achieve minimax fairness for unknown populations of sufficient size. Similar to our work, they minimize the risk of the worst-case group for the worst-case group partition, they use results from distributional robustness that focus the attention of the model exclusively on the high-risk samples (i.e., their model reduces the tail of the risk distribution). However, they do not explicitly account for Pareto efficiency, meaning that their solution may be sub-optimal on the population segment that lies below their high-risk threshold, doing unnecessary harm. The other recent method that tackles the minimax objective is adversarially reweighted learning (ARL) (Lahoti et al., 2020), where the model is trained to reduce a positive linear combination of the sample errors, these weighting coefficients are proposed by an adversary (implemented as a neural network), with the goal of maximizing the weighted empirical error. This method focuses + +on computationally identifiable subgroups, meaning that they can be characterized by a function $f: \mathcal{X} \times \mathcal{Y} \to [0,1]$ , (Hébert-Johnson et al., 2018). However, they do not provide an optimality guarantee on the adversary, nor do they pose a constraint on the computationally identifiable subgroups. Our theoretical results indicate that adding an easily interpretable group size constraint on this subgroup is necessary so that the worst-case partition does not yield a trivial, uniform classifier for the optimal adversary; this observation is validated in experimental results. + +# 3. Problem Formulation + +# 3.1. Minimax Fairness + +We first consider the supervised group fairness classification scenario (Barocas et al., 2019), where we have access to a dataset $\mathcal{D} = \{(x_i, y_i, a_i)\}_{i=1}^n \sim p(X, Y, A)^{\otimes n}$ containing $n$ i.i.d. triplets. Here $X \in \mathcal{X}$ denotes the input features, $Y \in \mathcal{Y}$ the categorical target variable, and $A \in \mathcal{A}$ group membership. We consider a classifier $h \in \mathcal{H}$ belonging to an hypothesis class $\mathcal{H}$ whose goal is to predict $Y$ from $X$ , $h: \mathcal{X} \to \Delta^{|\mathcal{Y}| - 1}$ ; note that $h(X)$ can take any value in the simplex and is readily interpretable as a distribution over labels $Y$ . Given a loss function $\ell: \Delta^{|\mathcal{Y}| - 1} \times \Delta^{|\mathcal{Y}| - 1} \to \mathbb{R}^+$ , fairness is considered in the context of a Multi-Objective Optimization Problem (MOOP), where the objective is to learn a classifier that minimizes the conditional group risks $\mathbf{r}(h) = \{r_a(h)\}_{a \in \mathcal{A}}$ , + +$$ +\begin{array}{l} \min _ {A} (r _ {1} (h), \dots , r _ {| A |} (h)), \\ \begin{array}{l} h \in \mathcal {H} \\ r _ {a} (h) = \mathbb {E} _ {X, Y | A = a} [ \ell (h (X), Y) ]. \end{array} \tag {1} \\ \end{array} +$$ + +The solution to this MOOP may not be unique (e.g., the optimal classifier of different groups differs), and therefore there is a set of optimal (Pareto) solutions that can be achieved. It is possible that none of these Pareto solutions satisfy some group fairness criteria (e.g., equality of risk), meaning that achieving perfect fairness comes at the cost of optimality (Kaplow & Shavell, 1999; Bertsimas et al., 2011). In this work we do not to compromise optimality, meaning that we do not degrade the performance of a low-risk group if it does not directly benefit another, and consider a minimax fairness approach (Rawls, 2001; 2009), where the goal is to find a Pareto optimal classifier that minimizes the worst-case group risk, + +$$ +\min _ {h \in \mathcal {H} _ {P _ {\mathcal {A}}}} \max _ {a \in \mathcal {A}} r _ {a} (h). \tag {2} +$$ + +$\mathcal{H}_{P_A}$ represents the set of properly Pareto optimal classifiers in $\mathcal{H}$ given a group set $\mathcal{A}$ as defined next. + +Definition 3.1. An hypothesis $h^* \in \mathcal{H}$ is Pareto optimal if $h^*$ is Pareto efficient, meaning that $\exists h' \in \mathcal{H} : \mathbf{r}(h') \prec \mathbf{r}(h)$ . Given a partition set $\mathcal{A}$ we denote the set of Pareto hypothesis in $\mathcal{H}$ as $\mathcal{H}_{P_A}$ . + +$$ +{ } ^ { 2 } \mathbf { r } ( h ^ { \prime } ) \prec \mathbf { r } ( h ) \text { ~ i f ~ } r _ { a } ( h ^ { \prime } ) \leq r _ { a } ( h ) \forall a \wedge \exists a ^ { \prime } : r _ { a ^ { \prime } } ( h ^ { \prime } ) < r _ { a ^ { \prime } } ( h ) +$$ + +Note that Definition 3.1 establishes that there is no other model in the hypothesis class whose associated group risks are uniformly better for all groups. + +# 3.2. Blind Pareto Fairness + +In this work we consider a more challenging problem, namely Blind Pareto Fairness (BPF), where the group variable $A$ and the conditional distribution $p(A|X,Y)$ are completely unknown (not just unobserved), even at training time. Here the goal is to learn a model that has the best performance on the worst-group risk of the worst partition density $p(A|X,Y)$ ("sensitive" group assignment), subject to a group size constraint $(p(A = a) \geq \rho, \forall a)$ . We formulate the following new problem, + +$$ +\begin{array}{l} R ^ {*} = \min _ {h \in \mathcal {H} _ {P, A}} \quad \max _ {p (A | X, Y)} \quad \max _ {a \in A} r _ {a} (h). \tag {3} \\ s. t. p (A) \succeq \rho^ {3} \\ \end{array} +$$ + +Here $R^*$ is the minimum worst group error achieved for the worst partition density with known number of partitions $|\mathcal{A}|$ . Since $\mathcal{H}_{P_A}$ is explicitly dependent on $p(A|X,Y)$ , the objective presented in Problem 3 seems ill-defined because the learner has to pick $h$ from the Pareto hypotheses $\mathcal{H}_{P_A}$ before the adversary can pick $p(A|X,Y)$ . However, this will not be a problem because we consider scenarios where both the loss function and the hypothesis set are convex, making the minimax and maximin formulations equivalent. Therefore, $p(A|X,Y)$ can be picked before $h$ , making $\mathcal{H}_{P_A}$ a well-defined set. + +One issue with the formulation in Problem 3 is that it is undetermined in the sense that it admits several worst partition densities and classifiers for $|\mathcal{A}| > 2$ . Fortunately, Lemma 3.1 shows that the minimum worst group error $R^{*}$ in Problem 3 is the same as the one achieved if we were to consider an alternative formulation where a variable $A \in \{0,1\}$ represents the worst-group risk membership. This makes the study of the binary problem attractive when we wish to minimize the number of assumptions we make on the protected groups. Here the objective becomes + +$$ +\begin{array}{l} R ^ {*} = \begin{array}{c c c} \min _ {h \in \mathcal {H} _ {P A}} & \max _ {a \in \{0, 1 \}} & r _ {a} (h), \\ & p (A | X, Y) \end{array} \tag {4} \\ s. t. p (A) \succeq \rho \\ \end{array} +$$ + +with $h^*, p^*(A|X, Y)$ achieving this solution. We overload the notation $\mathcal{H}_{P_A}$ in the context of Problem 4 to refer to the Pareto set for a binary group distribution. Figure 1 shows an example of the risks for the worst and best partitions at different sizes $\rho$ achieved with a method that optimizes for + +the worst case partition, like DRO or our proposed BPF (the latter shows better performance on the remaining partition owing to the Pareto constraint), versus deploying a baseline model that minimizes the empirical risk. + +Lemma 3.1 shows that the minimum worst risk $R^{*}$ is the same for problems 3 and 4, hence, we focus our analysis on the latter throughout the text. There are two main advantages of working with the binary problem, the first is that finding the worst partition $p(A \mid X, Y)$ for a given $h$ is straightforward when $|\mathcal{A}| = 2$ . The second is that, in general, we may not know the number of groups we wish to be fair to, and this equivalence shows that it is sufficient to specify the minimum size a group must have before it is considered for the purposes of minimax fairness. Moreover, restricting the minimum size of the partitions to be considered is an interpretable way of constraining the adversary. + +Lemma 3.1. Given an hypothesis class $\mathcal{H}$ and a finite alphabet, $\mathcal{A}: |\mathcal{A}| \geq 2$ , problems 3 and 4 have the same minimum worst-group risk solution $R^*$ for all $\rho$ where problem 3 is defined ( $\rho \leq \frac{1}{|\mathcal{A}|}$ ). + +A question that arises from Problem 4 is how the optimal classifier and partition function depend on the partition size. In Lemma 3.2, we show the existence of a critical size $\rho^{*}$ for standard classification losses (cross-entropy and Brier score) whereby solving Problem 4 for partitions smaller than $\rho^{*}$ leads to a uniformly random classifier. This result shows that attempting to be minimax fair w.r.t. arbitrarily small group sizes yields a trivial classifier with limited practical utility. Therefore, if one where to consider an adversary without any capacity restriction this would be it's optimal solution, something that we corroborate empirically. + +Lemma 3.2. Given Problem 4 with $p(Y|X) > 0 \forall X, Y,$ and let the classification loss be cross-entropy or Brier score. Let + +$$ +\bar {h} (X): \bar {h} _ {i} (X) = \frac {1}{| \mathcal {Y} |} \forall X, \forall i \in \{0, \dots , | \mathcal {Y} | - 1 \}, +$$ + +be the uniform classifier, and let $\bar{h} \in \mathcal{H}$ . There exists a critical partition size + +$$ +\rho^ {*} = | \mathcal {Y} | \mathbb {E} _ {X} \left[ \min _ {y} p (y \mid X) \right] \leq 1 +$$ + +such that solutions to Problem 4, $\forall \rho \leq \rho^{*}$ , are $h^* = \bar{h}$ and + +$$ +R ^ {*} = \bar {R} = \left\{ \begin{array}{l l} \log | \mathcal {Y} | & i f \ell = \ell_ {C E} \\ \frac {| \mathcal {Y} | - 1}{| \mathcal {Y} |} & i f \ell = \ell_ {B S} \end{array} \right.. +$$ + +That is, any partitions smaller than $\rho^{*}$ yield the uniform classifier with constant risk $\bar{R}$ . + +In some circumstances, we may wish to address fairness in situations where there may be a preferred outcome. It is + +![](images/73129b512877863c65d6d4bdf7ce03bea1bab26d5d3ae7bd7ee6e792909de958.jpg) +Figure 1. Worst and best crossentropy risks achieved by DRO, BPF and a baseline classifier for varying minimum size partitions $(\rho)$ on a synthetic example (see Section A.2). The tradeoffs shown for DRO and BPF correspond to model pairs that were optimized for a specific $\rho$ value (i.e., different points in the tradeoff curve correspond to different BPF and DRO classifiers). Lower worst group risks correspond to larger group sizes $(\rho)$ ; results for the same $\rho$ value are connected with a dashed line. We observe that BPF is able to achieve the same worst-case group performance that DRO achieves, but with better results on the non-critical partition owing to its Pareto optimality constraint, this is especially apparent on small group sizes. The baseline classifier suffers significantly larger worst group errors for small partition sizes. + +possible to capture this preference with other convex surrogate losses such as weighted crossentropy (wCE), defined as $-\sum_{i=1}^{|\mathcal{V}|} w_i \mathbf{1}(y=i) \log h_i(x)$ . In this scenario, it is also worthwhile to analyze the existence of critical classifiers and partition sizes. The proof presented in Supplementary Material Section A.1 shows a more general statement for a broader class of loss functions, including wCE, which may yield different critical classifiers and partition sizes, the restriction $p(Y|X) > 0$ is also lifted. + +It is straightforward to prove that $R^{*}$ is non-increasing with $\rho$ (see Supplementary Material A.1). A natural question that arises is what is the additional cost in optimality we pay if we apply subgroup robustness instead of optimizing for a known partition. Lemma 3.3 provides an upper bound for the cost of blind fairness, showing that it is at most the difference between $R^{*}$ and the risk of the baseline model. Moreover, the upper bound decreases with larger group size, and is in no scenario larger than the difference between the risk of the uniform classifier and the baseline classifier for BS and CE losses. + +Lemma 3.3. Given a distribution $p(X,Y)$ and any predefined partition group $p(A'|X,Y)$ with $A' \in \mathcal{A}'$ , $|\mathcal{A}'|$ finite. Let $\hat{h}, \hat{R} = \{\arg \min_{h \in \mathcal{H}} \max_{a' \in \mathcal{A}'} r_{a'}(h)\}$ be the minimax fair solution for this partition and its corresponding minimax risk. + +Let $h^*$ and $R^*$ be the classifier and risks that solve Problem 4 with $\rho = \min_{a' \in \mathcal{A}'} p(a')$ . Then the price of minimax fairness can be upper bounded by + +$$ +\max _ {a ^ {\prime} \in \mathcal {A} ^ {\prime}} r _ {a ^ {\prime}} \left(h ^ {*}\right) - \hat {R} \leq R ^ {*} - \min _ {h \in \mathcal {H}} r (h). ^ {6} \tag {5} +$$ + +In the following section, we provide a practical algorithm that asymptotically, solves Problem 4 and yields a classifier that both minimizes the worst-group risk and is also Pareto-efficient w.r.t. the remaining population. (All proofs are presented in the Supplementary Material A.1.) + +# 4. Optimization + +In order to develop our optimization approach, we begin by showing that for group sizes $\rho \leq \frac{1}{2}$ , we can drop the innermost max operator in Problem 4, and we only need to consider the risk for the $a = 1$ partition on a partition of size exactly equal to $\rho$ (i.e., $p(A = 1) = \rho$ ). This is presented in the following lemma. + +Lemma 4.1. Given Problem 4 with minimum group size $\rho \leq \frac{1}{2}$ , the following problems are value equivalent: + +$$ +R^{\mathrm{I}} = \min_{h\in \mathcal{H}_{P\mathcal{A}}}\max_{p(A|X,Y)}\max_{a\in \{0,1\}}r_{a}(h), +$$ + +$$ +s. t. p (A) \succeq \rho +$$ + +$$ +\begin{array}{l} R ^ {\mathrm {I I}} = \min _ {h \in \mathcal {H} _ {P, A}} \quad \max _ {p (A | X, Y)} \quad r _ {1} (h), \tag {6} \\ s. t. p (A = 1) = \rho \\ \end{array} +$$ + +$$ +R ^ {\mathrm {I}} = R ^ {\mathrm {I I}}. +$$ + +We note that the second problem in Eq. 6 is in itself an interesting optimization problem for $\rho > 1/2$ , since it equates to efficiently minimizing the risk of the at-risk majority. Next, Lemma 4.2 shows that the Pareto optimality constraint is easy to enforce if the base loss function $\ell(h(x), y)$ is both bounded (i.e., $\ell(h(x), y) \leq C \forall x, y, h \in \mathcal{X} \times \mathcal{Y} \times \mathcal{H}$ ), and strictly convex w.r.t. model $h$ , and if the hypothesis class $\mathcal{H}$ is a convex set as well. + +Lemma 4.2. Given the problem on the right hand side of Eq. 6, a convex hypothesis class $\mathcal{H}$ , and a bounded loss function $0 \leq \ell(h(x), y) \leq C \forall x, y, h \in \mathcal{X} \times \mathcal{Y} \times \mathcal{H}$ that is strictly convex w.r.t its first input $h(x)$ , the following problems are equivalent: + +$$ +\begin{array}{l} \mathcal {H} ^ {\mathrm {I}}, R ^ {\mathrm {I}} = \{\arg \} \min _ {h \in \mathcal {H} _ {P, A}} \max _ {p (A | X, Y)} r _ {1} (h) \\ s. t. p (A = 1) = \rho \\ \end{array} +$$ + +$$ +\begin{array}{l} \mathcal {H} ^ {\mathrm {I I}}, R ^ {\mathrm {I I}} = \left\{\arg \right\} \min _ {h \in \mathcal {H}} \quad \sup _ {p (A | X, Y)} r _ {1} (h), \tag {7} \\ s. t. p (A = 1) = \rho \\ p (A = 1 | X, Y) > 0, \forall X, Y \\ \end{array} +$$ + +$$ +R ^ {\mathrm {I}} = R ^ {\mathrm {I I}}, \mathcal {H} ^ {\mathrm {I}} \supseteq \mathcal {H} ^ {\mathrm {I I}}, +$$ + +where we explicitly add $\{\arg\}$ to discuss the hypotheses achieving these minimax solutions. The set of hypotheses $\mathcal{H}^{\mathrm{II}}$ are valid solutions to our problem, and correspond to the set of properly Pareto hypothesis (Geoffrion, 1968) which have the property of not admitting unbounded tradeoff between risks, see Definition 2.8.5 in (Miettinen, 2012). The BS loss satisfies both conditions in Lemma 4.2, CE loss also satisfies these conditions if the classifier assigns a minimum label probability for all values. The $\ell_2$ regression loss over a bounded set also satisfies these conditions. + +The supremum constraint on Lemma 4.2 is handled by slightly limiting adversary capacity and ensuring $p(A = 1|X,Y) \geq \epsilon > 0 \forall X, Y \in \mathcal{X} \times \mathcal{Y}$ , which leads to a minimax formulation. Furthermore, in the conditions of Lemma 4.2, we can exchange the minimum and the maximum without changing the problem, this leads to a feasible problem formulation based on importance weighting + +$$ +\begin{array}{l} \max _ {p (A | X, Y)} \min _ {h \in \mathcal {H}} \mathbb {E} _ {X, Y} [ \frac {p (A = 1 | X , Y)}{p (A = 1)} \ell (h (X), Y) ]. \\ p (A | X, Y) \quad n \in \mathcal {N} \quad T (\quad) \tag {8} \\ s. t. p (A - 1) = p \\ p (A = 1 | X, Y) \geq \epsilon \\ \end{array} +$$ + +Note that $\epsilon$ ensures that a minimal priority is assigned to each sample, even if belongs to the low-risk group. We solve Problem 8 using no-regret dynamics (Freund & Schapire, 1999), the solution is the Nash equilibrium of a two-player zero-sum game, where one player, the adversary, iteratively proposes partition distributions $p(A|X,Y)$ , the modeler then responds near optimally with a model $h$ , and incurs loss $r_1(h)$ . Based on the history of losses, the adversary iteratively refines its proposed partition function into the worst-case partition. + +To solve the above problem with parameter $\epsilon > 0$ , we leverage the theoretical results presented in (Chen et al., 2017) for improper robust optimization of infinite loss sets with oracles. We present the results in terms of a finite dataset with $n$ samples; assume that both players have access to $\{x_i, y_i\}_{i=1}^n \sim P(X,Y)^{\otimes n}$ , and let $t \in \{0,\dots,T\}$ indicate the current round of the zero-sum game. In each round $t$ , the modeler produces a classifier $h^t$ and the adversary proposes an empirical distribution of $p(A|X,Y)$ , denoted as $\alpha^t = \{\alpha_i^t\}_{i=1}^n \in \mathcal{U}_{\epsilon,\rho}$ such that $\mathcal{U}_{\epsilon,\rho} = \{\alpha : \alpha_i \in [\epsilon,1], \sum_i \frac{\alpha_i}{n} = \rho\}$ , where $\rho$ is the minimum partition size. The empirical risk (cost) of round $t$ is $L^t = L(h^t,\alpha^t)$ , with + +$$ +L (h, \boldsymbol {\alpha}) = \frac {\sum_ {i = 1} ^ {n} \alpha_ {i} \ell (h (x _ {i}) , y _ {i})}{n \rho}. \tag {9} +$$ + +Note that $L(h, \alpha)$ is the importance-weighted estimate of $r_1(h)$ over the samples in the dataset, that is $\mathbb{E}_{X,Y}[\frac{p(X,Y|A = 1)}{P(X,Y)}\ell (h(X),Y)] = \mathbb{E}_{X,Y}[\frac{p(A = 1|X,Y)}{p(A = 1)}\ell (h(X),Y)].$ + +In order to find the Nash equilibrium of this game, we use projected gradient ascent on the adversary, while the mod-er uses approximate best response with a $\gamma$ -approximate Bayesian oracle $h^t = M(\alpha^t)$ . In particular, we use a variant proposed in (Chen et al., 2017) for robust non-convex optimization. Algorithm 1 shows the proposed approach. + +# Algorithm 1 Blind Pareto Fairness + +Require: Inputs: Dataset $\{(x_i,y_i)\}_{i = 1}^n$ partition size $\rho$ + +Require: Hyper-parameters: rounds $T$ , parameter $\eta$ , adversary boundary coefficient $\epsilon > 0$ , $\gamma$ -approximate + +Bayesian solver $\mathbf{M}(\cdot)\simeq \arg \min_{h\in \mathcal{H}}L(h,\cdot)$ + +Initialize $\pmb{\alpha}^{0} = \hat{\pmb{\alpha}} = \{\rho\}_{i=1}^{n}$ + +Initialize classifier and loss + +$h^0 = \mathbf{M}(\hat{\alpha}),L^0 = L(h^0,\hat{\alpha})$ + +for round $t = 1,\dots ,T$ do + +Adversary updates partition function by projected gradient ascent: + +$$ +\begin{array}{l} \boldsymbol {\alpha} ^ {t} \leftarrow \boldsymbol {\alpha} ^ {t - 1} + \eta \nabla_ {\boldsymbol {\alpha}} L (h ^ {t}, \hat {\boldsymbol {\alpha}}) = \boldsymbol {\alpha} ^ {t - 1} + \eta \frac {\ell \left(h ^ {t} , y\right)}{n \rho} \\ \hat {\boldsymbol {\alpha}} \leftarrow \prod_ {\mathcal {U} _ {\epsilon , \rho}} (\boldsymbol {\alpha} ^ {t}), \mathcal {U} _ {\epsilon , \rho} = \{\boldsymbol {\alpha}: \alpha_ {i} \in [ \epsilon , 1 ], \sum_ {i} \frac {\alpha_ {i}}{n} = \rho \} \\ \end{array} +$$ + +Solver approximately solves for the current partition: + +$$ +h ^ {t} \leftarrow \mathbf {M} (\hat {\boldsymbol {\alpha}}) +$$ + +# end for + +Return: Classifier $h^T$ + +The proposed Algorithm 1 is an instantiation of Algorithm 3 in (Chen et al., 2017) for oracle efficient improper robust optimization with infinite loss sets. To implement the projection operator $\prod_{\mathcal{U}_{\epsilon, \rho}}(\cdot)$ , we use a variant of the algorithm proposed in (Duchi et al., 2008) for projections onto the simplex that also contemplates the hypercube constraint $[\epsilon, 1]$ . This projection update only requires access to the last risk evaluation on each sample during the training stage, making it a scalable and lightweight addition to the standard supervised training scenario. We can then immediately leverage the results in Theorem 7 in (Chen et al., 2017) to show that the algorithm converges. + +Lemma 4.3. Consider the setting of Algorithm 1, with parameter $\epsilon >0$ , and $\eta = \max_{\alpha \in \mathcal{U}_{\epsilon ,\rho}}\frac{\|\alpha\|_2}{\sqrt{2T}}\leq \sqrt{\frac{n\rho}{2T}}$ with $\mathcal{U}_{\epsilon ,\rho} = \{\alpha :\alpha_i\in [\epsilon ,1],\sum_i\frac{\alpha_i}{n} = \rho \}$ , and $L$ a 1-Lipschitz function w.r.t. $\alpha$ , let $P$ be a uniform distribution over the set of models $\{h^1,\ldots ,h^T\}$ , and let $R^{*}$ be the minimax solution to the loss presented in Eq. 9. Then we have + +$$ +\max _ {\boldsymbol {\alpha} \in \mathcal {U} _ {\epsilon , \rho}} \mathbb {E} _ {h \sim P} L (h, \boldsymbol {\alpha}) \leq \gamma R ^ {*} + \sqrt {\frac {2 n \rho}{T}}. +$$ + +As in (Chen et al., 2017), we use $h^T$ instead of the ensemble $\{h^1, \ldots, h^T\}$ . We use stochastic gradient descent (SGD) + +as our $\gamma$ -approximate Bayesian oracle, in practice, we alternate a single epoch of SGD with the adversary update for simplicity. We note that the 1-Lipschitz constraint can be relaxed to any $G$ -Lipschitz function by working through the no regrets guarantees for projected gradient descent of $G$ -Lipschitz functions in the proof provided in (Chen et al., 2017). + +Figure 2 shows how the performance of the recovered classifiers (trained for a given partition size $\rho$ ) is optimal for its own partition size, but sub-optimal for other $\rho$ values. These curves give a better picture on how risks are being traded off across samples. + +![](images/62073097cce97a8bf31afe91e9627b4f9ab072fd149f0011f51877f33c7435f6.jpg) + +![](images/2bd476703ebd3f1b33f3f0102ebd5c758fc58cd84b7f17ade539c654f03d031d.jpg) + +![](images/d2638edc9c8667e1a71ea324f6f1a950c9d519a8e97db6686cae7d6dbf55f992.jpg) +Figure 2. Crossentropy and error rates of BPF classifiers for varying (evaluation) partition sizes $\rho$ evaluated on the UCI Adult dataset. Each individual curve denotes the performance of a unique BPF classifier, trained for a particular $\rho$ , across a range of evaluation partition sizes on the test set. The uniform classifier is shown for reference. We observe how performance is traded off between low and high risk groups for varying partition sizes, in particular, smaller training partition sizes yield uniformly worse performance on the best group, no matter the evaluation partition size. Conversely, optimality on the worst group is dependent on how matched the train and test partition sizes are. + +![](images/fb7c1dc4d593e13f8014287ce8c30e015e9aad3363889b4220d94d20dd455150.jpg) + +# Generalization + +For a fixed, known distribution $p(A = 1|X,Y)$ it is straightforward to prove the following PAC bound for $r_1(h)$ . + +Lemma 4.4. Given $p(A = 1|X,Y) \geq \epsilon, \forall X,Y$ , $p(A = 1) = \rho$ , and a bounded loss function $0 \leq \ell(h(X),Y) \leq C, \forall X,Y,h$ we denote the expected and empirical importance weighted risk as $r_1(h) = \mathbb{E}_{X,Y}[\frac{p(A = 1|X,Y)}{p(A = 1)}\ell(h(X),Y)]$ and $\hat{r}_1(h) =$ + +$\sum_{i=1}^{n} \frac{p(A=1|x_i, y_i)}{np(A=1)} \ell(h(x_i), y_i)$ respectively. Where $h \in \mathcal{H}$ and $|\mathcal{H}|$ is the dimension of the hypothesis set. Under these conditions, the following PAC bound holds + +$$ +P \left(\max _ {h \in \mathcal {H}} | r _ {1} (h) - \hat {r} _ {1} (h) | \geq \frac {C}{\rho} \sqrt {\frac {\log \left(2 | \mathcal {H} | / \delta\right)}{2 n}}\right) \leq \delta +$$ + +We observe that the upper bound on the generalization error degrades for small $\rho$ values, since the ratio $\frac{p(A = 1|X,Y)}{p(A = 1)}$ is upper bound by $\frac{1}{\rho}$ . Note that, for the special distribution presented in Lemma 3.2, there is no generalization error since the risk of the resulting classifier is, by construction, distribution invariant. Although this is the case for small $\rho$ values in ideal scenarios, in practice we may still be able to over-fit to a small fraction of our samples in a way that still leads to larger-than-random errors in test samples. + +# 5. Experimental Results + +We experimentally validate our methods and theoretical results on a variety of standard datasets, we compare performance against DRO (Hashimoto et al., 2018), ARL (Lahoti et al., 2020), and a baseline classifier (empirical risk minimization). We show the trade-offs of each method on their worst group and the remaining population. As presented below (see Figure 3), the baseline method performs best on the low-risk population, but it suffers from large, fat tails in terms of loss distribution. We also show how both DRO and BPF empirically achieve the theoretical results laid in Lemma 3.2, with BPF having better results on the low-risk population than DRO, owing to the Pareto optimality constraint. Moreover, if the adversary's network on the ARL framework is given enough capacity, it degrades to the uniform (trivial) solution presented in Lemma 3.2 since it does not control for other restrictions on the partitions learned (e.g., group size). We also show that the performance of ARL can vary with adversarial network capacity (e.g., depth and width of the network). However, translating this to the effective size of the worst case partition being optimized is not easy to interpret or evaluate beforehand. + +Datasets. We used four standard fairness datasets for comparison. The UCI Adult dataset (Dua & Graff, 2017) which contains 48,000 records of individual's annual income as well as 13 other attributes, including race, gender, relationship status, and education level. The target task is income prediction (binary, indicating above or below $50K$ ). The Law School dataset (Wightman, 1998) contains law school admission data used to predict successful bar exam candidates; in our examples we limit ourselves to UGPA, LSAT scores and family income as input covariates. The COMPAS dataset (Barenstein, 2019) which contains the criminal history, serving time, and demographic information such as sex, + +age, and race of convicted criminals. The goal is prediction of recidivism per individual. $^{9}$ Lastly we used the MIMIC-III dataset, which consists of clinical records collected from adult ICU patients at the Beth Israel Deaconess Medical Center (Johnson et al., 2016). The objective is predicting patient mortality from clinical notes. We analyze clinical notes acquired during the first 48 hours of ICU admission following the pre-processing methodology in (Chen et al., 2018), ICU stays under 48 hours and discharge notes are excluded from the analysis. Tfidf statistics on the 1,000 most frequent words in clinical notes are taken as input features. + +![](images/5d2fc7010895dde6df7eabebf56eaf9f264ab77bd0c6909e4092981218369980.jpg) +UCI Adult + +![](images/c932e57946eddd623addf890422e3b80578e2f819e94364b51bed2440ad01cb5.jpg) +Law school + +![](images/cd7e0bca76333b6df66384fc780a222b0e5b0737f9352bc6d04a9a74eb9bd54a.jpg) +Compas + +![](images/c0d1f8db0fc20b4fe7eb5c5c846ff1cc08201df75c3e87da6277b9268ae91266.jpg) +MIMIC-III + +![](images/f879df8e985e7534b82b044a794a02eb0438ff34941782000d5340b581f9a336.jpg) + +![](images/35448517f58391fb62551174b708a9709f6def722d5a3c17f22af558a21f267f.jpg) + +![](images/941c84cd96d43bf4d72488b57e231cbeb27f8245a7ff97ff1577c29af90fa99c.jpg) + +![](images/4c00ae7bbdf0e182bbd6599c14bba7d3c32c4168240a4dbe422fe1bef8de56ef.jpg) + +![](images/b2e2ed5add74ed9bcc8ff6473a09a5c7df612d4a2a0f55a77e4fbf7f25832cd8.jpg) + +![](images/11d8de404d7717c9219545a318c8a7226e14a7dcc16aa233643705ebf181cc91.jpg) + +![](images/3fb9984f12418853fd9df3f0fcb8ce4d3f5f1966322be03a0b7cbcdf90d2b515.jpg) + +![](images/a54e880dfa113046e496a6c59ee35c2791a2e0d6c24d0938ccef19e88df857b5.jpg) + +![](images/4f72c9389eadd8ae3e0c617f2bf795d61de7b39d9dc1283de12dc34d6dcfd0d5.jpg) +Figure 3. Cross-entropy (CE) and error rate (Error) metrics on best and worst groups as a function of group size for BPF, DRO, ARL, and baseline classifiers; results for very high capacity adversarial networks for ARL (ARL HC) are also shown, random classifier shown for reference. Results are provided for UCI adult, law school, COMPAS, and MIMIC-III datasets. Cross-entropy of both ARL and baseline classifiers for the worst group are very large for small group size, DRO and BPF both approximate the theoretical result shown in Lemma 3.2. The main experimental difference between DRO and the proposed BPF is that BPF exhibits better results on the best group partition than DRO for the same level of worst group performance, owing to the Pareto restriction on the BPF classifier resulting in no-unnecessary-harm for any group (see also Figure 1). Error results largely mimic the observations on the cross-entropy metric. Results are reported on held out (test) data. + +![](images/304f05721e8bc8ebaa59f48e53d2669a70d00c2ed3f627ea24a4d5ca4e9adc23.jpg) + +![](images/15a8a3be6d38d0241e0603308ebdaca8c352c6d608d38909e8dc807436210924.jpg) + +![](images/7a95ffefe844be803614470482bd0603cef5b0daca723dd04a24cea5a3bf766a.jpg) + +Setup and Results. We train BPF for 18 minimum group sizes $\rho = \{0.05, \dots, 0.9\}$ and $\epsilon = 0.01$ , we report cross-entropy loss and error rate, $^{10}$ on the worst partition of the dataset (i.e., average over the worst $100 \times \rho\%$ samples based on cross-entropy loss), the values for the remaining low risk group is also reported to evaluate optimality. DRO models were trained on 18 equispaced values of their threshold parameter $(\eta \in [0,1])$ . For ARL, we tried four configurations for their adversarial network (adversary with 1 or 2 hidden layers with 256 or 512 units each), we additionally evaluated the same setup when the ARL adversary has access to the learned features of the classifier network, this setup still falls within the computationally identifiable scenario in their work, but offers a more challenging adversary, we denote these latter experiments as (ARL HC). The classifier architecture for BPF, ARL, and DRO was standardized to a single-layer MLP with 512 hidden units. In all cases we use cross-entropy loss and same input data. Results correspond to the best hyper-parameter for each group size; mean and standard deviations are computed using 5-fold cross-validation, all figures are reported on held out (test) data. Further implementation details are provided in Supplementary Material, Section A.4. + +Figure 3 shows the performance of the best and worst groups across partition sizes. Both DRO and BPF recover results close to the random classifier for the smaller group sizes, which aligns with the results shown in Lemma 3.2, that is, below a certain partition size (e.g., $\rho \simeq 0.3$ for adult dataset) the average cross-entropy of the worst group is the risk of the uniform classifier (log 2). We observe that the performance of ARL seems to be dataset dependent, but is generally able to reduce worst-case risks w.r.t. the baseline classifier for small partition sizes. The high capacity ARL (ARL HC) behaves as expected in most cases, producing results much more closely aligned with the uniform classifier, this supports our theoretical results stating that an unconstrained adversary should converge to the uniform classifier. Altogether, both BPF and DRO have the best performance; they are consistently able to recover the best worst group risk, and do well on preserving performance on the remaining samples. BPF also provides an explicit description of the worst group partition, and the option to control trade-offs between groups with the use of the $\epsilon$ parameter. In some situations, the difference between these two methods can become more pronounced, but this is dataset dependent. Additional details on this comparison are provided in Supplementary Material, Section A.2. + +Although none of the compared models address disparities along predefined populations, we can nonetheless observe how each classifier performs on these groups. Table 1 shows + +accuracy conditioned on different demographics for each competing method on the Adult dataset. We observe that the different methods achieve results close to the uniform classifier for small partition sizes as expected. In many cases, the results for BPF are better than ARL and DRO for each protected attribute (at same $\rho$ value). We also observe that on several minorities, the BPF model provides the best utility values out of all the competing methods, BPF is also the best model at preserving worst group performance. + +Table 2 shows how target labels and predefined sensitive groups are represented in the high risk group identified by BPF, values reported on held out data. We observe that, for low partition sizes, outcomes are balanced across groups (in concordance with Lemma 3.2). As the partition size increases, the composition of the high risk group becomes more similar to the base distribution. Similar results to tables 1 and 2 are provided in Supplementary Material A.3 for the remaining datasets. + +
Method/ρWhiteBlackAsian-PacIOther
Prop(%)85.6%9.6%2.9%1.8%
ARL .1549.1%51.9%50.2%52.8%
DRO .1550.5%50.0%49.5%50.1%
BPF .1552.3%52.5%51.0%53.5%
ARL .3560.3%65.9%59.5%63.8%
DRO .3557.4%59.4%57.3%59.5%
BPF .3565.0%69.7%64.1%68.5%
ARL .4568.6%77.5%68.6%74.3%
DRO .4580.2%88.0%79.1%86.9%
BPF .4580.2%88.0%79.1%86.9%
+ +Table 1. Accuracy across demographic partitions (groups given no special consideration by the algorithms) in the Adult dataset for ARL, DRO and BPF models for varying partition sizes. + +
GroupProp(%)BPF .15BPF .35BPF .45
Proportion on Worst Partition, Ethnicity/Income
White/064.243.844.853.5
White/121.445.344.935.6
Black/08.52.73.04.6
Black/11.12.92.51.8
Asian-PacI/02.11.81.71.9
Asian-PacI/10.82.01.81.4
Other/01.50.40.40.8
Other/10.31.00.80.5
+ +Table 2. Demographic composition of worst groups as a function of minimum partition size on the Adult dataset. BPF homogenizes outcomes across partitions and protected attributes. For larger group sizes, the demographics of the partition approach that of the baseline population. + +# 6. Discussion + +In this work we formulate and analyze subgroup robustness, particularly in the context of fairness without demographics or labels. Our goal is to recover a model that minimizes the risk of the worst-case partition of the input data subject to a minimum size constraint, while we additionally constrain this model to be Pareto efficient w.r.t. the low-risk population as well. This means that we are optimizing for the worst unknown subgroup without causing unnecessary harm on the rest of the data. We show that it is possible to protect high risk groups without explicit knowledge of their number or structure, only the size of the smallest one, and that there is a minimum partition size under which the random classifier is the only minimax option for cross-entropy and Brier score losses. + +We propose BPF, an algorithm that provably converges to a properly Pareto minimax solution, it requires minimal modifications to the standard learning pipeline of a standard model, and can scale easily to large datasets. Our results on a variety of standard fairness datasets show that this approach reduces worst-case risk as expected, and produces better models than competing methods for the low-risk population, thereby avoiding unnecessary harm. It identifies high risk samples and is easy to interpret since the user can control the optimal adversary through the use of a target worst partition size. + +If a policymaker has a desired risk tradeoff instead of a target group size, we can search for the smallest partition size achieving this tradeoff using the proposed BPF; this now guarantees that the recovered model can satisfy this risk tradeoff for the worst possible partition up to size $\rho$ , and for any smaller partition size there exists a partition such that this tradeoff is violated. Moreover, the tradeoffs between the worst and best group for a fixed group size $\rho$ can be controlled with the weight's lower bound $\epsilon$ . + +Future work includes incorporating additional domain-specific constraints on the worst partition and developing an algorithm that combines BPF with knowledge about some subgroups that must be protected as well. + +# References + +Barenstein, M. Propublica's compas data revisited. arXiv preprint arXiv:1906.04711, 2019. +Barocas, S. and Selbst, A. D. Big data's disparate impact. Calif. L. Rev., 104:671, 2016. +Barocas, S., Hardt, M., and Narayanan, A. Fairness and Machine Learning. fairmlbook.org, 2019. http://www.fairmlbook.org. + +Bertsimas, D., Farias, V. F., and Trichakis, N. The price of fairness. Operations Research, 59(1):17-31, 2011. +Chen, I., Johansson, F. D., and Sontag, D. Why is my classifier discriminatory? In Advances in Neural Information Processing Systems, pp. 3539-3550, 2018. +Chen, J., Kallus, N., Mao, X., Svacha, G., and Udell, M. Fairness under unawareness: Assessing disparity when protected class is unobserved. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pp. 339-348, 2019. +Chen, R. S., Lucier, B., Singer, Y., and Syrgkanis, V. Robust optimization for non-convex objectives. In Advances in Neural Information Processing Systems, pp. 4705-4714, 2017. +Chouldechova, A. and Roth, A. The frontiers of fairness in machine learning. arXiv preprint arXiv:1810.08810, 2018. +Diana, E., Gill, W., Kearns, M., Kenthapadi, K., and Roth, A. Convergent algorithms for (relaxed) minimax fairness. arXiv preprint arXiv:2011.03108, 2020. +Dua, D. and Graff, C. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml. +Duchi, J., Shalev-Shwartz, S., Singer, Y., and Chandra, T. Efficient projections onto the 11-ball for learning in high dimensions. In Proceedings of the 25th international conference on Machine learning, pp. 272-279, 2008. +Duchi, J., Hashimoto, T., and Namkoong, H. Distributionally robust losses for latent covariate mixtures. arXiv preprint arXiv:2007.13982, 2020. +Dwork, C., Hardt, M., Pitassi, T., Reingold, O., and Zemel, R. Fairness through awareness. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pp. 214-226, 2012. +Elliott, M. N., Fremont, A., Morrison, P. A., Pantoja, P., and Lurie, N. A new method for estimating race/ethnicity and associated disparities where administrative records lack self-reported race/ethnicity. *Health Services Research*, 43 (5p1):1722-1736, 2008. +Freund, Y. and Schapire, R. E. Adaptive game playing using multiplicative weights. Games and Economic Behavior, 29(1-2):79-103, 1999. +Geoffrion, A. M. Proper efficiency and the theory of vector maximization. Journal of Mathematical Analysis and Applications, 22(3):618-630, 1968. +Gupta, M., Cotter, A., Fard, M. M., and Wang, S. Proxy fairness. arXiv preprint arXiv:1806.11212, 2018. + +Hajian, S., Bonchi, F., and Castillo, C. Algorithmic bias: From discrimination discovery to fairness-aware data mining. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 2125-2126, 2016. +Hardt, M., Price, E., and Srebro, N. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems, pp. 3315-3323, 2016. +Hashimoto, T. B., Srivastava, M., Namkoong, H., and Liang, P. Fairness without demographics in repeated loss minimization. arXiv preprint arXiv:1806.08010, 2018. +Hébert-Johnson, U., Kim, M. P., Reingold, O., and Rothblum, G. N. Calibration for the (computationally-identifiable) masses. arXiv preprint arXiv:1711.08513, 2017. +Hébert-Johnson, U., Kim, M., Reingold, O., and Rothblum, G. Multicalibration: Calibration for the (computationally-identifiable) masses. In International Conference on Machine Learning, pp. 1939-1948. PMLR, 2018. +Holstein, K., Wortman Vaughan, J., Daumé III, H., Dudik, M., and Wallach, H. Improving fairness in machine learning systems: What do industry practitioners need? In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems, pp. 1-16, 2019. +Johnson, A. E., Pollard, T. J., Shen, L., Li-wei, H. L., Feng, M., Ghassemi, M., Moody, B., Szolovits, P., Celi, L. A., and Mark, R. G. Mimic-iii, a freely accessible critical care database. Scientific data, 3:160035, 2016. +Kallus, N., Mao, X., and Zhou, A. Assessing algorithmic fairness with unobserved protected class using data combination. arXiv preprint arXiv:1906.00285, 2019. +Kaplow, L. and Shavell, S. The conflict between notions of fairness and the Pareto principle. *American Law and Economics Review*, 1(1):63-77, 1999. +Kearns, M., Neel, S., Roth, A., and Wu, Z. S. Preventing fairness gerrymandering: Auditing and learning for subgroup fairness. In International Conference on Machine Learning, pp. 2564-2572, 2018. +Lahoti, P., Beutel, A., Chen, J., Lee, K., Prost, F., Thain, N., Wang, X., and Chi, E. H. Fairness without demographics through adversarially reweighted learning. arXiv preprint arXiv:2006.13114, 2020. +Martinez, N., Bertran, M., and Sapiro, G. Minimax Pareto fairness: A multi objective perspective. In International Conference on Machine Learning, 2020. + +Mas-Colell, A., Whinston, M. D., Green, J. R., et al. Microeconomic Theory, volume 1. Oxford University Press New York, 1995. +Miettinen, K. Nonlinear multiobjective optimization, volume 12. Springer Science & Business Media, 2012. +Mitchell, S., Potash, E., Barocas, S., D'Amour, A., and Lum, K. Prediction-based decisions and fairness: A catalogue of choices, assumptions, and definitions. arXiv preprint arXiv:1811.07867, 2018. +Rawls, J. Justice as Fairness: A Restatement. Harvard University Press, 2001. +Rawls, J. A Theory of Justice. Harvard University Press, 2009. +Sohoni, N., Dunnmon, J., Angus, G., Gu, A., and Re, C. Addressing hidden stratification: Fine-grained robustness in coarse-grained classification problems, 2020a. http://hazyresearch.stanford.edu/hidden-stratification, July2020. +Sohoni, N. S., Dunnmon, J. A., Angus, G., Gu, A., and Ré, C. No subclass left behind: Fine-grained robustness in coarse-grained classification problems. To Appear in Neural Information Processing Systems, 2020b. http://stanford.edu/~nims/no_subclass_left_behind.pdf. +Ustun, B., Liu, Y., and Parkes, D. Fairness without harm: Decoupled classifiers with preference guarantees. In International Conference on Machine Learning, pp. 6373-6382, 2019. +Veale, M. and Binns, R. Fairer machine learning in the real world: Mitigating discrimination without collecting sensitive data. *Big Data & Society*, 4(2):2053951717743530, 2017. +Wightman, L. F. LSAC National Longitudinal Bar Passage Study. LSAC Research Report Series. 1998. +Zhang, Y. Assessing fair lending risks using race/ethnicity proxies. Management Science, 64(1):178-197, 2018. \ No newline at end of file diff --git a/blindparetofairnessandsubgrouprobustness/images.zip b/blindparetofairnessandsubgrouprobustness/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..64d9d04b3a4902d96d6723bcc92e15c87b68ec4e --- /dev/null +++ b/blindparetofairnessandsubgrouprobustness/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45d203f2a0f200a187e314ba3077e69fc0bec47f0cfe2e1fc68fc779f16f8d6d +size 404082 diff --git a/blindparetofairnessandsubgrouprobustness/layout.json b/blindparetofairnessandsubgrouprobustness/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..57dd8beec80d7c7b3f7e69339394285584793ef9 --- /dev/null +++ b/blindparetofairnessandsubgrouprobustness/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf627e50740667eae64d6ab1c37725b48a9ac942fd5d7be8f371ec5f499094d3 +size 489326 diff --git a/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_content_list.json b/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7302afe5aa61906077f19757844314154ac4e47c --- /dev/null +++ b/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d28b695419a0b33283b08fab13f86f39410282ad07c0a7c93e90d26f9e59d82 +size 89308 diff --git a/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_model.json b/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..43cc04233761e593ace1d2b2d4e437d68b48a582 --- /dev/null +++ b/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2bd1f7c842963ddf6e5bde82e989565f6d89356a297519f088c12333c8f5a12 +size 111815 diff --git a/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_origin.pdf b/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4d5d2c09ff6d69379657334f575e5eb18e4fa266 --- /dev/null +++ b/boostingforonlineconvexoptimization/1d35cb22-67de-4fae-ae98-67f6d5254f1d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe9d5d3582812c1b2067e8cdf947d28e69c3d5cd3b8ef0d3e6b210cedcd9d9c9 +size 340050 diff --git a/boostingforonlineconvexoptimization/full.md b/boostingforonlineconvexoptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7783ca63529e61d0252f21a41ebd3bfd19d66a23 --- /dev/null +++ b/boostingforonlineconvexoptimization/full.md @@ -0,0 +1,539 @@ +# Boosting for Online Convex Optimization + +Elad Hazan $^{12}$ Karan Singh $^{3}$ + +# Abstract + +We consider the decision-making framework of online convex optimization with a very large number of experts. This setting is ubiquitous in contextual and reinforcement learning problems, where the size of the policy class renders enumeration and search within the policy class infeasible. Instead, we consider generalizing the methodology of online boosting. We define a weak learning algorithm as a mechanism that guarantees multiplicatively approximate regret against a base class of experts. In this access model, we give an efficient boosting algorithm that guarantees nearoptimal regret against the convex hull of the base class. We consider both full and partial (a.k.a. bandit) information feedback models. We also give an analogous efficient boosting algorithm for the i.i.d. statistical setting. Our results simultaneously generalize online boosting and gradient boosting guarantees to contextual learning model, online convex optimization and bandit linear optimization settings. + +# 1. Introduction + +In the classical problem of prediction from expert advice (Cesa-Bianchi et al., 1997), a learner iteratively makes decisions and receives loss according to an arbitrarily chosen loss function. Learning in terms of guaranteeing an absolute bound on the loss incurred would be a hopeless task, but the learner is assisted by a pool of experts (or hypotheses). The goal of the learner is thus to minimize regret, or the difference of total loss to that of the best expert in hindsight. + +For this canonical problem, numerous methods have been devised and refined, some notably based on the multiplicative weights algorithm (Littlestone & Warmuth, 1994; Arora + +*Equal contribution 'Google AI Princeton, Princeton, NJ, USA 'Princeton University, Princeton, NJ, USA 'Microsoft Research, Redmond, WA, USA. Correspondence to: Elad Hazan , Karan Singh . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +et al., 2012). It is well established that the regret can be bounded by $O(\sqrt{T\log|\mathcal{H}|})$ , where $|\mathcal{H}|$ is the number of experts, and that this is tight. However, in many problems of interest, the class of experts is too large to efficiently manipulate. This is particularly evident in contextual learning, where the experts are policies – functions mapping contexts to action. In such instances, even if a regret bound of $O(\sqrt{T\log|\mathcal{H}|})$ is meaningful, the algorithms achieving this bound are computationally inefficient; their running time is linear in $|\mathcal{H}|$ . + +One approach to deal with this computational difficulty is to grant the leaner a best-in-hindsight (or ERM) oracle. This has been explored in both the stochastic bandit (Langford & Zhang, 2008; Agarwal et al., 2014; Dudik et al., 2011) and (transductive) online settings (Rakhlin & Sridharan, 2016; Syrgkanis et al., 2016b;a; Hazan & Koren, 2016). + +In this paper, we consider a different approach towards addressing computational intractability, motivated by the observation that it is often possible to design simple rules-of-thumb (Viola & Jones, 2001) that perform slightly better than random guesses. We propose that the learner has access to a "weak learner" - an computationally cheap mechanism capable of guaranteeing multiplicatively approximate regret against a base hypotheses class. Such considerations arise in the theory of boosting (Schapire & Freund, 2012b), which was originally devised in the context of binary classification in the statistical/i.i.d. setting. A weak learner, defined as one which is capable of better-than-random classification, is used by a boosting algorithm to create an accurate classifier. By analogy, the regret-based notion of weak learner we define here is a natural extension of the concept of weak learning to online convex optimization. + +We design efficient algorithms that when provided weak learners compete with the convex hull of the base hypotheses class with near-optimal regret. We further consider different information feedback models: both full gradient feedback, as well as linear bandit (function value) feedback, and derive efficient sublinear regret algorithms for these settings. + +# 1.1. Setting and contributions + +The setting of online convex optimization (OCO) generalizes the problem of prediction from expert advice to a general convex decision set $\mathcal{K} \subseteq \mathbb{R}^d$ , and adversarily + +chosen convex loss functions $f_{t}:\mathbb{R}^{d}\mapsto \mathbb{R}$ . We consider a hypothesis class $\mathcal{H}\subseteq \mathcal{C}\mapsto \mathcal{K}$ , where each hypothesis $h\in \mathcal{H}$ maps a context (or feature vector) in the context set $c_{t}\in \mathcal{C}$ to an action $h(c_{t})\in \mathcal{K}$ . + +Definition 1. An online learning algorithm $\mathcal{W}$ is a $\gamma$ -weak OCO learner (WOCL) for a class $\mathcal{H}$ and edge $\gamma \in (0,1)$ , if for any sequence of contexts chosen from $\mathcal{C}$ and unit linear loss functions $f_{1},\ldots,f_{T}$ , we have + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} f _ {t} \left(\mathcal {W} \left(c _ {t}\right)\right) \leq \gamma \cdot \min _ {h \in \mathcal {H}} \sum_ {t = 1} ^ {T} f _ {t} \left(h \left(c _ {t}\right)\right) \\ + (1 - \gamma) \sum_ {t = 1} ^ {T} f _ {t} ^ {\mu} + \operatorname {R e g r e t} _ {T} (\mathcal {W}), \\ \end{array} +$$ + +where $f^{\mu} = \int_{\mathbf{x} \in \mathcal{K}} f(\mathbf{x}) d\mu$ is the average value of $f$ under the uniform distribution $\mu$ . + +In classical boosting, a weak learner is an algorithm that offers an edge over a random guess. Since $f_{t}^{\mu}$ is precisely the loss associated with a uniform random guess, the above definition is a generalization of the classic notion. In addition, note that such a definition is invariant under constant offsets to the function value. + +It is convenient to henceforth assume that the convex decision set is centered, that is $\int_{\mathbf{x} \in K} \mathbf{x} d\mu = 0$ . If so, note that for any linear function $f: \mathcal{K} \to \mathcal{R}$ , $f_t^\mu = f(\int_{\mathbf{x}} \mathbf{x} d\mu) = 0$ . Under this assumption, we can rephrase $\gamma$ -WOCL as + +$$ +\sum_ {t = 1} ^ {T} f _ {t} \left(\mathcal {W} \left(c _ {t}\right)\right) \leq \gamma \cdot \min _ {h \in \mathcal {H}} \sum_ {t = 1} ^ {T} f _ {t} \left(h \left(c _ {t}\right)\right) + \operatorname {R e g r e t} _ {T} (\mathcal {W}). \tag {1} +$$ + +Let $\mathrm{CH}(\mathcal{H})$ be the convex hull of the hypothesis class. Our goal is to design an algorithm $\mathcal{A}$ which minimizes regret vs. the best hypothesis in the convex hull of the base class: + +$$ +\operatorname {R e g r e t} = \sum_ {t = 1} ^ {T} f _ {t} \left(\mathcal {A} \left(c _ {t}\right)\right) - \min _ {h \in C H (\mathcal {H})} \sum_ {t = 1} ^ {T} f _ {t} \left(h \left(c _ {t}\right)\right). +$$ + +In this model, our main result is an efficient algorithm, whose guarantee is given by: + +Theorem 2 (Main). Algorithm 1 with parameters $\gamma, N$ , maintains $N$ copies of $\gamma$ -WOCL, and generates a sequence actions $\mathbf{x}_1, \ldots, \mathbf{x}_T$ , such that + +$$ +\boxed {R e g r e t = O \left(\frac {T}{\gamma \sqrt {N}} + \frac {1}{\gamma} R e g r e t _ {T} (\mathcal {W})\right).} +$$ + +${}^{1}f\left( x\right)$ is a unit loss function if $\mathop{\max }\limits_{{x \in \mathcal{K}}}f\left( x\right) -$ $\mathop{\min }\limits_{{x \in K}}f\left( x\right) \leq 1$ . This scaling is w.l.o.g. and all results hold with a different constant otherwise. + +The formal theorem which we state and prove below has explicit constants that depend on the diameter of $\kappa$ (as opposed to $|\mathcal{H}|$ ) and the Lipschitz constants of the loss functions. These are hidden for brevity. Notably, Algorithm 1 achieves the following goals: + +1. Its running time does not depend on $|\mathcal{H}|$ , but rather only on the other natural parameters of the problem, notably the parameter $N$ . +2. The regret it guarantees is with respect to a stronger benchmark than the best hypothesis in the base class. It competes with the best convex combination of hypotheses from the base class, rather than the best one. +3. Finally, the regret guarantee is not multiplicatively approximate anymore; it is directly with respect to the best convex combination without the $\gamma$ factor. + +# 1.2. Related Work + +Boosting and ensemble methods are fundamental in all of machine learning and data science, see e.g. (Olshen, 2001) for a retrospective viewpoint and (Schapire & Freund, 2012a) for a comprehensive text. + +Originally boosting was studied for statistical learning and the realizable setting. For a framework that encompasses the different boosting methods see (Brukhim et al., 2020). + +More recently boosting was extended to real-valued prediction via the theory of gradient boosting (Friedman, 2002), and to the online setting (Leistner et al., 2009; Chen et al., 2012; 2014; Beygelzimer et al., 2015b;a; Agarwal et al., 2019; Jung et al., 2017; Jung & Tewari, 2018; Brukhim & Hazan, 2020). In each of these works, a certain component prevents the result from applying to the full OCO setting. Either the weak learner has a parameter $\gamma = 1$ , the convex decision sets are restricted, or the loss functions are restricted. + +Our work is the first to generalize online boosting to real-valued prediction in the full setting of online convex optimization, that allows for arbitrary convex decision sets and arbitrary approximation factor $\gamma$ . This requires the use of a new extension operator, defined henceforth. + +For extensive background on online learning and online convex optimization see (Hazan, 2019; Shalev-Shwartz et al., 2012). + +The contextual experts and bandits problems have been proposed in (Langford & Zhang, 2008) as a decision making framework with large number of policies. In the online setting, several works study the problem with emphasis on efficient algorithms given access to an ERM oracle (Rakhlin & Sridharan, 2016; Syrgkanis et al., 2016b;a; Rakhlin & Sridharan, 2016). + +Another related line of work in online learning studies the possibility of $\alpha$ -regret minimization given access to approximation oracles with an approximate weak learner (Kakade et al., 2009; Hazan et al., 2018). This weaker notion of $\alpha$ -regret only generates approximately optimal decisions. In contrast, our result gives a stronger guarantee of standard regret, and the regret is compared to a stronger benchmark of convex combination of experts. + +# 2. Improper learning and Extension operator + +# 2.1. Preliminaries + +For a convex set $\mathcal{K}$ and scalar $c > 0$ we denote by $c\mathcal{K}$ the set of all scaled points, i.e. + +$$ +c \mathcal {K} = \left\{c \mathbf {x} \text {s . t .} \mathbf {x} \in \mathcal {K} \right\}. +$$ + +The algorithmic primitives introduced next use a smoothing operator. Let $f$ be $G$ -Lipschitz continuous. The smoothing operator may be defined via inf-convolution or Moreau-Yoshida regularization: + +$$ +M _ {\delta} [ f ] = \inf _ {y \in \mathbb {R} ^ {d}} \left\{f (y) + \frac {1}{2 \delta} \| x - y \| ^ {2} \right\}. +$$ + +The following lemma elucidates well known properties of such an operator (see (Beck, 2017)). + +Lemma 3. The smoothed function $\hat{f}_{\delta} = M_{\delta}[f]$ satisfies: + +1. $\hat{f}_{\delta}$ is $\frac{1}{\delta}$ -smooth, and $G$ -Lispchitz. +2. $|\hat{f}_{\delta}(\mathbf{x}) - f(\mathbf{x})| \leq \frac{\delta G^2}{2}$ for all $\mathbf{x} \in \mathbb{R}^d$ . + +# 2.2. The extension operator + +The main difficulty we face is that the weak learner only has a $\gamma$ -approximate regret guarantee. To cope with this, the algorithm we describe henceforth scales the predictions returned by the weak learner by a factor of $\frac{1}{\gamma}$ . This algorithm, a rescaled variant of the Frank-Wolfe method, guarantees competitiveness with the convex hull of the base class, if we could somehow play actions in $\frac{1}{\gamma} \mathcal{K}$ , instead of $\mathcal{K}$ . Since these actions do not belong to the decision set, they are infeasible. + +This presents a significant challenge. Ideally, we would like that for every action in $\gamma^{-1}\mathcal{K}$ , one could find an action in $\mathcal{K}$ of comparable (or lesser) loss (for all loss functions). It can be seen that some natural families of functions, i.e. linear functions, do not admit such an operation. For linear loss functions, for example, extrema always occur on the boundary of the set. + +To remedy this, we modify the loss function being fed to the Frank-Wolfe algorithm in the first place. We call this + +modification an extension of the loss function outside $\kappa$ . Define $\mathbf{Dist}(\mathbf{x},\mathcal{K})$ the Euclidean distance to $\kappa$ , and the Euclidean projection $\Pi_{\kappa}$ as + +$$ +\mathbf {D i s t} (\mathbf {x}, K) = \min _ {\mathbf {y} \in \mathcal {K}} \| \mathbf {y} - \mathbf {x} \|, +$$ + +$$ +\Pi_{\mathcal{K}}(\mathbf{x}) = \operatorname *{arg min}_{\mathbf{y}\in \mathcal{K}}\| \mathbf{y} - \mathbf{x}\| +$$ + +Definition 4 $((\mathcal{K},\delta ,\kappa)$ -extension). The extension operator over $\kappa \subseteq \mathbb{R}^d$ is defined as: + +$$ +X _ {\mathcal {K}, \delta , \kappa} [ f ] (x) = M _ {\delta} [ f (x) + \kappa \cdot \mathbf {D i s t} (\mathbf {x}, \mathcal {K}) ]. +$$ + +We henceforth denote by $G$ an upper bound on the norm of the gradients of the loss functions over $\mathcal{K}$ , and set $\kappa = G = \max_t \max_{\mathbf{x} \in \mathbb{R}^d} \| \nabla f_t(\mathbf{x}) \|$ . The important take-away from these operators is the following lemma, whose importance is crucial in the OCO boosting algorithm 1. The extended loss functions are smooth, agree with the original loss on $\mathcal{K}$ , and possess the property that projection of any action in $\mathcal{R}^d$ onto $\mathcal{K}$ does not increment the extended loss value. In short, it permits projections of infeasible points that are obtained from the weak learners to the feasible domain without an increase in cost. + +Lemma 5. The $(\mathcal{K},\delta ,\kappa)$ -extension of a $G$ -lipschitz function $\hat{f} = X_{K,\delta ,\kappa}[f]$ satisfies the following: + +1. For every point $\mathbf{x} \in \mathcal{K}$ , we have $|\hat{f}(\mathbf{x}) - f(\mathbf{x})| \leq \frac{\delta G^2}{2}$ . +2. The projection of a point $\mathbf{x}$ onto $\kappa$ does not increase the $(\kappa, \kappa, \delta)$ -extended function value by more than $G^2\delta$ . + +$$ +\hat {f} (\Pi_ {\mathcal {K}} (\mathbf {x})) \leq \hat {f} (\mathbf {x}) + G ^ {2} \delta . +$$ + +Proof. Since $\mathbf{Dist}(\mathbf{x},\mathcal{K}) = 0$ for all $x\in \mathcal{K}$ , the first claim follows immediately from the properties of the smoothing operator as stated in Lemma 3. Denote $\mathbf{x}_{\pi} = \Pi_{\mathcal{K}}(\mathbf{x})$ . + +$$ +\begin{array}{l} \hat {f} (\mathbf {x} _ {\pi}) - \hat {f} (\mathbf {x}) \\ \leq f (\mathbf {x} _ {\pi}) - f (\mathbf {x}) - \kappa \cdot \operatorname {D i s t} (\mathbf {x}, \mathcal {K}) + G ^ {2} \delta \\ = f (\mathbf {x} _ {\pi}) - f (\mathbf {x}) - \kappa \| \mathbf {x} - \mathbf {x} _ {\pi} \| + G ^ {2} \delta \\ \leq G \| \mathbf {x} - \mathbf {x} _ {\pi} \| - \kappa \| \mathbf {x} - \mathbf {x} _ {\pi} \| + G ^ {2} \delta = G ^ {2} \delta \\ \end{array} +$$ + +Here the first inequality follows from Lemma 3.2, and the second follows from the lipschitz assumptions on $f$ . The last equality results from the choice $\kappa = G$ . + +# 3. Algorithm and Main Theorems + +Algorithm 1 efficiently converts a weak online learning algorithm into an OCO algorithm with vanishing regret in a black-box manner. The idea is to apply the weak learning algorithm on linear functions that are gradients of the loss. + +# Algorithm 1 BoOCO = Boosting Online Convex Opt. + +1: Input: $N$ copies of the $\gamma$ -WOCL $\mathcal{W}^1, \mathcal{W}^2, \ldots, \mathcal{W}^N$ , parameters $(\eta_1, \ldots, \eta_N)$ , $\delta, \kappa = G$ . +2: for $t = 1$ to $T$ do +3: Receive context $c_t$ . +4: Choose $\mathbf{x}_t^0\in \mathcal{K}$ arbitrarily. +5: for $i = 1$ to $N$ do +6: Define $\mathbf{x}_t^i = (1 - \eta_i)\mathbf{x}_t^{i - 1} + \eta_i\frac{1}{\gamma}\mathcal{W}^i (c_t)$ +7: end for +8: Predict $\mathbf{x}_t = \Pi_{\mathcal{K}}(\mathbf{x}_t^N)$ and suffer loss $f_{t}(\mathbf{x}_{t})$ +9: Obtain loss function $f_{t}$ , create $\hat{f}_{t} = X_{\mathcal{K},\delta ,\kappa}[f_{t}]$ . +10: for $i = 1$ to $N$ do +11: Pass to $\mathcal{W}^i$ the linear loss function $f_t^i$ . + +$$ +f _ {t} ^ {i} (\mathbf {x}) = \nabla \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i - 1}\right) \cdot \mathbf {x}. +$$ + +12: end for +13: end for + +The algorithm then recursively applies another weak learner on the gradients of the residual loss, and so forth. + +The main performance guarantee we prove is summarized in the following theorem. + +Theorem 6 (Main). The actions $\mathbf{x}_t$ generated by Algorithm 1 with parameter $\delta = \sqrt{\frac{D^2}{\gamma N}}$ , $\eta_i = \min \left\{\frac{2}{i}, 1\right\}$ satisfy + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} f _ {t} \left(\mathbf {x} _ {t}\right) - \min _ {h \in C H (\mathcal {H})} \sum_ {t = 1} ^ {T} f _ {t} \left(h \left(c _ {t}\right)\right) \\ \leq \frac {4 G D T}{\gamma \sqrt {N}} + \frac {2 G D}{\gamma} R e g r e t _ {T} (\mathcal {W}). \\ \end{array} +$$ + +# 4. Analysis + +Define $\hat{f}_t = X[f_t] = M_\delta [f_t + G\cdot \mathbf{Dist}(\mathbf{x},\mathcal{K})]$ . We apply the setting of $\kappa = G$ , as required by Lemma 5, and by Lemma 3, $\hat{f}_t$ is $\frac{1}{\delta}$ -smooth. + +Let $h^* = \arg \min_{h \in CH(\mathcal{H})} \sum_{t=1}^{T} f_t(h(c_t))$ be the best hypothesis in the convex hull in hindsight. We define $\mathbf{x}_t^* = h^*(c_t)$ as the decisions of this hypothesis. + +The main crux of the proof is given by the following lemma. + +Lemma 7. Suppose $\hat{f}_t$ 's are $\beta$ -smooth, and $\hat{G}$ lipschitz. Then, + +$$ +\sum_ {t = 1} ^ {T} \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {N}\right) - \sum_ {t = 1} ^ {T} \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) \leq \frac {2 \beta D ^ {2} T}{\gamma^ {2} N} + \frac {\hat {G} D}{\gamma} R e g r e t _ {T} (\mathcal {W}). +$$ + +Proof. Define for all $i = 0,1,2,\ldots ,N$ + +$$ +\Delta_ {i} = \sum_ {t = 1} ^ {T} \left(\hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i}\right) - \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right)\right). +$$ + +Recall that $\hat{f}_t$ is $\beta$ smooth by our assumption. Therefore: + +$$ +\begin{array}{l} \Delta_ {i} = \sum_ {t = 1} ^ {T} \left[ \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i - 1} + \eta_ {i} \left(\frac {1}{\gamma} \mathcal {W} ^ {i} \left(c _ {t}\right) - \mathbf {x} _ {t} ^ {i - 1}\right)\right) - \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) \right] \\ \leq \sum_ {t = 1} ^ {T} \left[ \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i - 1}\right) - \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) + \eta_ {i} \nabla \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i - 1}\right) \cdot \left(\frac {1}{\gamma} \mathcal {W} ^ {i} \left(c _ {t}\right) \right. \right. \\ \left. - \mathbf {x} _ {t} ^ {i - 1}\right) + \frac {\eta_ {i} ^ {2} \beta}{2} \| \frac {1}{\gamma} \mathcal {W} ^ {i} (c _ {t}) - \mathbf {x} _ {t} ^ {i - 1} \| ^ {2} ] \\ \end{array} +$$ + +By using the definition and linearity of $f_{t}^{i}$ , we have + +$$ +\begin{array}{l} \Delta_ {i} \leq \sum_ {t = 1} ^ {T} \left[ \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i - 1}\right) - \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) \right. \\ \left. + \eta_ {i} \left(f _ {t} ^ {i} \left(\frac {1}{\gamma} \mathcal {W} ^ {i} \left(c _ {t}\right)\right) - f _ {t} ^ {i} \left(\mathbf {x} _ {t} ^ {i - 1}\right)\right) + \frac {\eta_ {i} ^ {2} \beta D ^ {2}}{2 \gamma^ {2}} \right] \\ = \Delta_ {i - 1} + \sum_ {t = 1} ^ {T} \eta_ {i} \left(\frac {1}{\gamma} f _ {t} ^ {i} \left(\mathcal {W} ^ {i} \left(c _ {t}\right)\right) - f _ {t} ^ {i} \left(\mathbf {x} _ {t} ^ {i - 1}\right)\right) \\ + \sum_ {t = 1} ^ {T} \frac {\eta_ {i} ^ {2} \beta D ^ {2}}{2 \gamma^ {2}} \\ \end{array} +$$ + +Now, note the following equivalent restatement of the WOCL guarantee, which again utilizes linearity of $f_{t}^{i}$ to conclude: linear loss on a convex combination of a set is equal to the same convex combination of the linear loss applied to individual elements. + +$$ +\begin{array}{l} \frac {1}{\gamma} \sum_ {t = 1} ^ {T} f _ {t} ^ {i} \left(\mathcal {W} ^ {i} \left(c _ {t}\right)\right) \\ \leq \min _ {h \in \mathcal {H}} \sum_ {t = 1} ^ {T} f _ {t} ^ {i} (h (c _ {t})) + \frac {\hat {G} D \operatorname {R e g r e t} _ {T} (\mathcal {W})}{\gamma} \\ = \min _ {h \in C H (\mathcal {H})} \sum_ {t = 1} ^ {T} f _ {t} ^ {i} (h \left(c _ {t}\right)) + \frac {\hat {G} D \operatorname {R e g r e t} _ {T} (\mathcal {W})}{\gamma} \\ \end{array} +$$ + +Using the above and that $h^* \in CH(\mathcal{H})$ , we have + +$$ +\begin{array}{l} \Delta_ {i} \leq \Delta_ {i - 1} + \sum_ {t = 1} ^ {T} \left[ \eta_ {i} \nabla \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {i - 1}\right) \cdot \left(\mathbf {x} _ {t} ^ {\star} - \mathbf {x} _ {t} ^ {i - 1}\right) \right. \\ \left. + \frac {\eta_ {i} ^ {2} \beta D ^ {2}}{2 \gamma^ {2}} \right] + \eta_ {i} \frac {\hat {G} D}{\gamma} \operatorname {R e g r e t} _ {T} (\mathcal {W}) \\ \leq \Delta_ {i - 1} (1 - \eta_ {i}) + \frac {\eta_ {i} ^ {2} \beta D ^ {2} T}{2 \gamma^ {2}} + \eta_ {i} R _ {T} \\ \end{array} +$$ + +where the last inequality uses the convexity of $\hat{f}_t$ and $R_{T} = \frac{\hat{G}D}{\gamma}\mathrm{Regret}_{T}(\mathcal{W})$ . We thus have the recurrence + +$$ +\Delta_ {i} \leq \Delta_ {i - 1} (1 - \eta_ {i}) + \eta_ {i} ^ {2} \frac {\beta D ^ {2} T}{2 \gamma^ {2}} + \eta_ {i} R _ {T}. +$$ + +Denoting $\hat{\Delta}_i = \Delta_i - R_T$ + +$$ +\hat {\Delta} _ {i} \leq \hat {\Delta} _ {i - 1} (1 - \eta_ {i}) + \eta_ {i} ^ {2} \frac {\beta D ^ {2} T}{2 \gamma^ {2}}. +$$ + +Lemma 8. Let $\{h_t\}$ be a sequence that satisfies the recurrence + +$$ +h _ {t + 1} \leq h _ {t} (1 - \eta_ {t}) + \eta_ {t} ^ {2} c. +$$ + +Then taking $\eta_t = \min \{1, \frac{2}{t}\}$ implies + +$$ +h _ {t} \leq \frac {4 c}{t}. +$$ + +This is a recursive formula that can be solved by applying Lemma 8; we obtain that $\hat{\Delta}_N \leq \frac{2\beta D^2 T}{\gamma^2 N}$ . + +We are ready to prove the main guarantee of Algorithm 1. + +Proof of Theorem 6. Using both parts of Lemma 5 in succession, we have + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} f _ {t} \left(\mathbf {x} _ {t}\right) - \sum_ {t = 1} ^ {T} f _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) \\ \leq \sum_ {t = 1} ^ {T} \hat {f} _ {t} (\mathbf {x} _ {t}) - \sum_ {t = 1} ^ {T} \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) + \delta G ^ {2} T \\ \leq \sum_ {t = 1} ^ {T} \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {N}\right) - \sum_ {t = 1} ^ {T} \hat {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) + 2 \delta G ^ {2} T \\ \end{array} +$$ + +Next, recall by Lemma 3, that $\hat{f}_t$ is $\frac{1}{\delta}$ -smooth. By applying Lemma 7, and optimizing $\delta$ , we have + +$$ +\begin{array}{l} \sum_ {t = 1} ^ {T} f _ {t} \left(\mathbf {x} _ {t}\right) - \sum_ {t = 1} ^ {T} f _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right) \\ \leq 2 \delta G ^ {2} T + \frac {2 D ^ {2} T}{\delta \gamma^ {2} N} + \frac {\hat {G} D}{\gamma} \operatorname {R e g r e t} _ {T} (\mathcal {W}) \\ = \frac {4 G D T}{\gamma \sqrt {N}} + \frac {\hat {G} D}{\gamma} \operatorname {R e g r e t} _ {T} (\mathcal {W}) \\ \end{array} +$$ + +Lemma 9. $\operatorname{Dist}(\mathbf{x},\mathcal{K})$ is 1-Lipschitz, + +Using the above lemma, we claim that $\hat{G} \leq 2G$ . Therefore, using Lemma 3, $\| \nabla f_t^i(x_t^i) \| = \| \nabla \hat{f}_t(x_t^i)) \| \leq 2G$ . + +Proof of Lemma 9. Observe the following. + +$$ +\begin{array}{l} \mathbf {D i s t} (\mathbf {x}, \mathcal {K}) - \mathbf {D i s t} (\mathbf {y}, \mathcal {K}) \\ = \| \mathbf {x} - \Pi_ {\mathcal {K}} (\mathbf {x}) \| - \| \mathbf {y} - \Pi_ {\mathcal {K}} (\mathbf {y}) \| \\ \leq \| \mathbf {x} - \Pi_ {\mathcal {K}} (\mathbf {y}) \| - \| \mathbf {y} - \Pi_ {\mathcal {K}} (\mathbf {y}) \| \\ \leq \| \mathbf {x} - \mathbf {y} \| \\ \end{array} +$$ + +triangle inequality + +![](images/43cf4725f5c96c3f468bd736c53636a263790146da60e77fee0159ae954fff92.jpg) + +Proof of Lemma 8. This is proved by induction on $t$ . + +Induction base. For $t = 1$ , we have + +$$ +h _ {2} \leq h _ {1} (1 - \eta_ {1}) + \eta_ {1} ^ {2} c = c \leq 4 c +$$ + +Induction step. + +$$ +\begin{array}{l} h _ {t + 1} \leq (1 - \eta_ {t}) h _ {t} + \eta_ {t} ^ {2} c \\ \leq \left(1 - \frac {2}{t}\right) \frac {4 c}{t} + \frac {4 c}{t ^ {2}} \quad \text {i n d u c t i o n h y p o t h e s i s} \\ = \frac {4 c}{t} \left(1 - \frac {1}{t}\right) \\ \leq \frac {4 c}{t} \cdot \frac {t}{t + 1} \quad \frac {t - 1}{t} \leq \frac {t}{t + 1} \\ = \frac {4 c}{t + 1} \\ \end{array} +$$ + +![](images/c22420ef4a5ede7c6bcb24fff770e10d5643a89bafd6e9c01ac2729a29851933.jpg) + +# 5. Boosting for Bandit Linear Optimization + +Recall that the setting of Bandit Linear Optimization (BLO) is exactly the same as OCO, but (1) the cost functions are linear, and (2) the feedback for the decision maker is the cost it incurs (no gradient information). We use the notation that our linear cost function at time $t$ is: + +$$ +f _ {t} (\mathbf {x}) = f _ {t} ^ {\top} \mathbf {x}, f _ {t} \in \mathbb {R} ^ {d}. +$$ + +To boost in the linear bandit setting, we apply techniques for unbiased gradient estimation. Namely, we use randomness to create a random linear function whose expectation is the actual linear function. We can then hope to use the previous algorithm on the random linear functions and obtain a probabilistic regret bound. + +For the rest of this section, we assume the following, + +Assumption 1. The convex decision set $\mathcal{K}$ contains the unit simplex $K\supseteq \Delta_{d}$ + +This assumption is very unrestrictive: by scaling and rotation, any set $\mathcal{K}$ which is non-degenerate contains the simplex. Scaling changes regret by a constant factor, and thus we scale so as to contain the unit simplex for notational convenience. An axis-aligning rotation does not affect the regret bound. We use standard basis aligned simplex for notational simplicity. + +We can now use standard randomized exploration to create an unbiased estimator of the loss function, as per the following scheme. Let $b_{t}$ be a Bernoulli random variable with parameter $\eta$ . Let $i_{t}$ be chosen uniformly at random from $i_{t} \in \{1,2,\dots,d\}$ . + +$$ +\tilde {f} _ {t} (i) = \left\{ \begin{array}{l l} 0 & i \neq i _ {t} \\ 0 & i = i _ {t}, b _ {t} = 0 \\ \frac {d}{\eta} \times f _ {t} (i _ {t}) & i = i _ {t}, b _ {t} = 1 \end{array} \right. \tag {2} +$$ + +Clearly the expectation of the random vector $\tilde{f}_t$ equals $\mathbb{E}[\tilde{f}_t] = f_t$ . We can now use this random variable as feedback for Algorithm 1, as given in Algorithm 2. + +Algorithm 2 BoBLO = Boosting Bandit Linear Opt. +1: Input: parameters $\eta$ , Algorithm 1 instance $\mathcal{A}$ . +2: for $t = 1$ to $T$ do +3: Observe context $c_t$ . +4: Draw random Bernoulli $b_t$ w. parameter $\eta$ . +5: if $b_t = 1$ then +6: Pick a coordinate basis $i_t \in \mathcal{R}^d$ vector randomly. +7: Play $\mathbf{x}_t = i_t$ . +8: Pass $\tilde{f}_t$ as per Equation (2) to $\mathcal{A}$ . +9: else +10: Play $\mathbf{x}_t = \mathcal{A}(c_t)$ , and pass the 0 loss vector to $\mathcal{A}$ . +11: end if +12: end for + +Notice that Algorithm 2 calls upon weak learners for OCO with full information. For this algorithm, our main performance guarantee is as follows. The resulting bound is sub-linear whenever the full-information regret bound is sublinear. Therefore, boosting in bandit linear settings is feasible whenever the full-information version is feasible, albeit at a slower rate. + +Theorem 10 (Boosting for Bandit Linear Optimization). The predictions $\mathbf{x}_t$ generated by Algorithm 2 satisfy + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {t = 1} ^ {T} f _ {t} (\mathbf {x} _ {t}) \right] - \inf _ {h \in C H (\mathcal {H})} \sum_ {t = 1} ^ {T} f _ {t} (h (c _ {t})) \\ \leq G D \sqrt {T \left(\frac {4 d T}{\gamma \sqrt {N}} + \frac {2 d}{\gamma} R e g r e t _ {T} (\mathcal {W})\right)} \\ \end{array} +$$ + +Proof. Let $\mathbf{y}_t = \mathcal{A}(c_t)$ . Observe that + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {t = 1} ^ {T} f _ {t} (\mathbf {x} _ {t}) \right] - \inf _ {h \in C H (\mathcal {H})} \sum_ {t = 1} ^ {T} f _ {t} (h (c _ {t})) \\ \leq \mathbb {E} \left[ \sum_ {t = 0} ^ {T} \left(\widetilde {f} _ {t} \left(\mathbf {y} _ {t}\right) - \widetilde {f} _ {t} \left(\mathbf {x} _ {t} ^ {\star}\right)\right) \right] + \eta G D T \\ \leq \frac {4 D \tilde {G} T}{\gamma \sqrt {N}} + \frac {2 D \tilde {G}}{\gamma^ {2}} \operatorname {R e g r e t} _ {T} (\mathcal {W}) + \eta T \quad \text {T h e o r e m 6} \\ \leq \frac {1 6 D d G T}{\eta \gamma \sqrt {N}} + \frac {8 d D G}{\eta \gamma} \operatorname {R e g r e t} _ {T} (\mathcal {W}) + \eta T \\ \end{array} +$$ + +Above, we use $\tilde{G}$ for an upper bound on the gradients of $\tilde{f}_t$ . Lastly, by construction the gradients of the loss function $\tilde{f}_t$ are bounded by $\frac{dG}{\eta}$ . Balancing $\eta$ concludes the claim + +# 5.1. Application to contextual bandits + +The contextual bandits problem is one of the most well studied special cases of contextual BLO. In multi-armed + +contextual bandits, the decision set is a set of $K$ discrete arms, the losses are [0, 1]-bounded, and the feedback available to learner is solely the loss of the arm it picks. This is exactly BLO for the decision set $\mathcal{K} = \Delta_K$ . We state a corollary of our result for this setting. + +Corollary 11 (Multi-armed Contextual Bandits). The predictions $\mathbf{x}_t$ generated by Algorithm 2 with the decision set $\mathcal{K} = \Delta_K$ and the loss set $[0,1]^K$ satisfy + +$$ +\begin{array}{l} \mathbb {E} \left[ \sum_ {t = 1} ^ {T} f _ {t} \left(\mathbf {x} _ {t}\right) \right] - \inf _ {h \in \mathcal {H}} \sum_ {t = 1} ^ {T} f _ {t} \left(h \left(c _ {t}\right)\right) \\ \leq K \sqrt {T \left(\frac {4 T}{\gamma \sqrt {N}} + \frac {2}{\gamma} R e g r e t _ {T} (\mathcal {W})\right)} \\ \end{array} +$$ + +# 6. Boosting for Stochastic Contextual Optimization + +In this section we give an alternative viewpoint of our boosting results from the lens of stochastic contextual optimization. The mathematical development is analogous to the previous results, but the statement of results may be of independent interest in statistical learning theory and contextual learning. + +Let $\mathcal{K} \subseteq \mathbb{R}^d$ be the (convex) decision set, and $\mathcal{C}$ be the set of possible contexts. In the Stochastic Contextual Optimization problem the aggregate loss attributable to a hypothesis is the expected cost of its actions with respect to a joint distribution $\mathcal{D}$ over the context set $\mathcal{C}$ and the set of convex cost functions over the decision set $\mathcal{K}$ . + +$$ +F _ {\mathcal {D}} (h) = \mathbb {E} _ {(f, c) \sim \mathcal {D}} [ f (h (c)) ]. +$$ + +Instead of explicit optimization over the hypothesis class, we assume that we have access to experts that are approximately competitive with the base hypothesis class. More formally, we define a weak optimizer as follows. + +Definition 12. A $\gamma$ -weak contextual optimizer is a learning algorithm that, when given samples from a distribution $\mathcal{D}$ over unit linear loss functions and contexts, outputs a mapping $\mathcal{W}: \mathcal{C} \to \mathcal{K}$ such that + +$$ +F _ {\mathcal {D}} (\mathcal {W}) \leq \gamma \cdot \min _ {h \in \mathcal {H}} F _ {\mathcal {D}} (h) + \varepsilon . +$$ + +Typically $\varepsilon$ scales as $\sim \frac{1}{\sqrt{m}}$ when the learner is given $m$ samples from the distribution $\mathcal{D}$ . + +The results in this section do not follow blackbox from the previous ones. While online boosting algorithms operate in more permissive settings than statistical ones, as they do not require the context and loss vectors to be sampled i.i.d., the corresponding assumption on the weak learners for the online setting are stronger too. + +# 6.1. Algorithm and main theorem + +Algorithm 3 below makes use of $N$ weak optimizers, and generates a hypothesis $h: \mathcal{C} \to \mathcal{K}$ such that the following theorem holds. Notice that the resulting guarantee delivers a solution which is stronger in two aspects than the weak optimization oracle: + +1. The resulting solution competes with the convex hull of $\mathcal{H}$ , rather than the best fixed $h\in \mathcal{H}$ . +2. The resulting solution removes the $\gamma$ approximation factor of the weak optimizers. + +Theorem 13 (Main-SCO). The hypothesis $h$ generated by Algorithm 3 with parameter $\delta = \sqrt{\frac{D^2}{\gamma N}}$ satisfy + +$$ +F _ {\mathcal {D}} (h) - \inf _ {h ^ {\star} \in C H (\mathcal {H})} F _ {\mathcal {D}} (h ^ {\star}) \leq \frac {4 G D}{\gamma \sqrt {N}} + \frac {2 G D}{\gamma} \varepsilon . +$$ + +Algorithm 3 B4CO = Boosting for Contextual Opt. + +1: Input: $\gamma$ -weak contextual optimizer $O$ , parameters $\{\eta_1, \dots, \eta_N\}$ , $\delta, \kappa = G$ , distribution $\mathcal{D}$ . +2: Choose $h^0$ arbitrarily from $\mathcal{H}$ . +3: for $i = 1$ to $N$ do +4: Define a distribution $\mathcal{D}^i$ specified via the following sampling oracle: + +Sample $(f,c)\sim \mathcal{D}$ , and define + +$$ +\hat {f} = X _ {\mathcal {K}, \delta , \kappa} [ f ] +$$ + +Define a linear loss function + +$$ +f ^ {i} (\mathbf {x}) = \nabla \hat {f} (h ^ {i - 1} (c)) \cdot \mathbf {x} +$$ + +Output $(f^i, c)$ . + +5: Call a weak optimizer on the distribution $\mathcal{D}^i$ to get a hypothesis $\mathcal{W}^i$ . +6: Define $h^i = (1 - \eta_i)h^{i-1} + \frac{\eta_i}{\gamma}\mathcal{W}^i$ +7: end for +8: Return predictor $h$ , defined as $h(c) = \Pi_{\mathcal{K}}(h^N(c))$ . + +As before, for a convex loss function $f$ , define $\hat{f} = X_{\mathcal{K},\delta ,G}[f]$ , and note that $\hat{f}_t$ is $\frac{1}{\delta}$ -smooth. Notations we use below: + +1. $F(h) = \mathbb{E}_{(f,c)\sim \mathcal{D}}[f(h(c))]$ +2. $\hat{F} (h) = \mathbb{E}_{(f,c)\sim \mathcal{D}}[\hat{f} (h(c))]$ + +Lemma 14. Suppose, for any $f\in \mathcal{F}$ $\hat{f}$ is $\beta$ -smooth,and $\max_{f\in \mathcal{F},x\in \mathcal{K}}\| \nabla \hat{f} (\mathbf{x})\| \leq \hat{G}.$ Then, + +$$ +\hat {F} (h) - \hat {F} (h ^ {\star}) \leq \frac {2 \beta D ^ {2}}{\gamma^ {2} N} + \frac {\hat {G} D}{\gamma} \varepsilon . +$$ + +Proof. Let $h^* = \arg \min_{h \in CH(\mathcal{H})} F(h)$ . Denote for all $i = 0,1,2,\ldots,N$ , $\Delta_i = \hat{F}(h^i) - \hat{F}(h^\star)$ . + +Recall that $\hat{f}_t$ is $\beta$ smooth by our assumption. Thus, + +$$ +\begin{array}{l} \Delta_ {i} = \hat {F} (h ^ {i}) - \hat {F} (h ^ {\star}) \\ = \mathbb {E} _ {f, c \sim \mathcal {D}} [ \hat {f} (h ^ {i} (c)) ] - \hat {F} (h ^ {\star}) \\ = \mathbb {E} _ {f, c \sim \mathcal {D}} \left[ \hat {f} \left(h ^ {i - 1} (c) + \eta_ {i} \left(\frac {1}{\gamma} \mathcal {W} ^ {i} (c) - h ^ {i - 1} (c)\right) \right. \right] \\ - F (h ^ {\star}) \\ \leq \mathbb {E} _ {f, c \sim \mathcal {D}} [ \hat {f} _ {t} (h ^ {i - 1} (c)) \\ + \eta_ {i} \nabla \hat {f} (h ^ {i - 1} (c)) \cdot \left(\frac {1}{\gamma} \mathcal {W} ^ {i} (c) - h ^ {i - 1} (c)\right) \\ + \frac {\eta_ {i} ^ {2} \beta}{2} \| \frac {1}{\gamma} h ^ {i - 1} (c) - \mathcal {W} ^ {i} (c) \| ^ {2} ] - \hat {F} (h ^ {\star}) \\ \leq \mathbb {E} _ {f, c \sim \mathcal {D}} [ \hat {f} (h ^ {i - 1} (c)) \\ + \eta_ {i} \left(f ^ {i} \left(\frac {1}{\gamma} \mathcal {W} ^ {i} (c)\right) - f _ {t} ^ {i} \left(h ^ {i - 1} (c)\right)\right) \\ \left. + \frac {\eta_ {i} ^ {2} \beta D ^ {2}}{2 \gamma^ {2}} \right] - \hat {F} (h ^ {\star}) \\ \end{array} +$$ + +Using linearity of $f^i$ , which implies that optimal aggregate loss values are equal over $\mathcal{H}$ and $CH(\mathcal{H})$ hypotheses classes, and the definition of weak learning, we have + +$$ +\begin{array}{l} \Delta_ {i} \leq \Delta_ {i - 1} \\ + \eta_ {i} \mathbb {E} _ {f, c \sim \mathcal {D}} \left[ \nabla \hat {f} _ {t} \left(h ^ {i - 1} (c)\right) \cdot \left(h ^ {\star} (c) - h ^ {i - 1} (c)\right) \right] \\ + \frac {\eta_ {i} ^ {2} \beta D ^ {2}}{2 \gamma^ {2}} + \eta_ {i} \frac {\hat {G} D \varepsilon}{\gamma} \\ \leq \Delta_ {i - 1} (1 - \eta_ {i}) + \frac {\eta_ {i} ^ {2} \beta D ^ {2}}{2 \gamma^ {2}} + \eta_ {i} \frac {\hat {G} D \varepsilon}{\gamma} \\ \end{array} +$$ + +where the last step follows from the convexity of $f$ . We thus have the recurrence + +$$ +\Delta_ {i} \leq \Delta_ {i - 1} (1 - \eta_ {i}) + \eta_ {i} ^ {2} \frac {\beta D ^ {2}}{2 \gamma^ {2}} + \eta_ {i} \frac {\hat {G} D \varepsilon}{\gamma}. +$$ + +As before, substituting $\hat{\Delta}_i = \Delta_i - \frac{\hat{G}D\varepsilon}{\gamma}$ , and applying Lemma 8, gives us $\hat{\Delta}_N \leq \frac{2\beta D^2}{\gamma^2 N}$ . + +Proof of Theorem 13. Using Lemma 5, we have, + +$$ +\begin{array}{l} F (h) - F \left(h ^ {\star}\right) \\ = \mathbb {E} _ {f, c} [ f (h (c)) ] - \mathbb {E} _ {f, c} [ f (h ^ {\star} (c)) ] \\ \leq \mathbb {E} _ {f, c} [ \hat {f} (h (c)) ] - \mathbb {E} _ {f, c} [ \hat {f} (h ^ {\star} (c)) ] + \delta G ^ {2} \\ \leq \mathbb {E} _ {f, c} [ \hat {f} (h ^ {N} (c)) ] - \mathbb {E} _ {f, c} [ \hat {f} (h ^ {\star} (c)) ] + 2 \delta G ^ {2} \\ \end{array} +$$ + +
Boston dataset
WLN=2N=3N=4N=5Improvement
Decision Stumps1.0000.9410.8910.8530.82117.9%
Ridge Regression1.0000.9800.9851.0091.0602.0%
Tiny MLP1.0000.9870.9660.9340.9208.0%
Diabetes dataset
WLN=2N=3N=4N=5Improvement
Decision Stumps1.0000.9750.9600.9520.94115.9%
Ridge Regression1.0000.9860.9740.9650.9564.4%
Tiny MLP1.0000.9820.9810.9870.9653.5%
California Housing dataset
WLN=2N=3N=4N=5Improvement
Decision Stumps1.0000.9690.9460.9320.9227.8%
Ridge Regression1.0001.0191.0411.0661.094-1.9%
Tiny MLP1.0000.8600.8610.8880.83516.5%
+ +Figure 1. Performance of the boosting algorithm on 3 different datasets, averaged across 20 runs, as a function of the weak learning class and the number of weak learners. The entries indicate normalized loss value with the base/weak learner loss set to one. + +By Lemma 3, that $\hat{f}$ is $\frac{1}{\delta}$ -smooth. By applying Lemma 14: + +$$ +F (\mathcal {A}) - F (h ^ {\star}) \leq 2 \delta G ^ {2} + \frac {2 D ^ {2}}{\delta \gamma^ {2} N} + \frac {\hat {G} D}{\gamma} \varepsilon +$$ + +Because $\mathbf{Dist}(x, K)$ is 1-Lipschitz, using Lemma 3, $\| \nabla f_t^i(x_t^i) \| = \| \nabla \hat{f}_t(x_t^i) \| \leq 2G$ . Choosing the suggested value of $\delta$ yields the proof. + +# 7. Experimental Results + +While the primary contribution of this work is theoretical, empirically testing our proposal serves as a sanity check for the theoretical results. Also, as stated in the related work, the proposed algorithm is the first of its kind in terms of being able to simultaneously operate with general convex losses and sets, and with multiplicatively approximate (inexact) weak learners. Consequently, the role of experiments here is to corroborate the theory, and is not aimed at achieving state-of-the-art on the considered datasets. + +To validate our results, we check if the proposed algorithm is indeed capable of boosting the accuracy of concrete instantiations of weak learners. Three online weak learners were considered: decision stumps, ridge regression, and a tiny multi-layer perceptron with one hidden unit trained via online gradient descent. + +For each choice of weak learner class, we considered the performance of the boosting algorithm (Algorithm 1) across multiple rounds of boosting or number of weak learners; the computational burden of the algorithm scales linearly with the latter. We evaluated the weak learners and the boosting + +algorithm on 3 publicly available datasets3 for regression with square loss, averaging each across 20 runs. The step size $\eta$ was set to 0.01, and $\gamma$ was chosen to be 0.1 – these values were not tuned. We present the results in Table 1. Further experimental details and code are detailed in the supplement. + +The results demonstrate the boosting for online convex optimization does indeed succeed in boosting the accuracy while using only few weak learners (equivalently, within a few rounds of boosting), and therefore, with a reasonably small increase in computation. The improvement is most pronounced for decision stumps, since this is an especially impoverished base class. Also, note that a convex combination of linear models is linear. Therefore, boosting a linear model (like ridge regression) has no expressivity benefit. Mirroring this, the improvements in the ridge regression setting are least prominent, and in some cases negative. + +# 8. Conclusions + +We study the problem of online convex optimization in the contextual setting. To cope with the computational challenges, we take a boosting approach, and generalize the methodology of gradient boosting and online boosting to contextual online convex optimization. + +Our derivation introduces a new extension operator for convex functions over convex domains which may be of independent interest. + +# Acknowledgements + +Elad Hazan was supported in part by National Science Foundation Award 1704860. + +# References + +Agarwal, A., Hsu, D., Kale, S., Langford, J., Li, L., and Schapire, R. Taming the monster: A fast and simple algorithm for contextual bandits. In International Conference on Machine Learning, pp. 1638-1646, 2014. +Agarwal, N., Brukhim, N., Hazan, E., and Lu, Z. Boosting for dynamical systems. arXiv preprint arXiv:1906.08720, 2019. +Arora, S., Hazan, E., and Kale, S. The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121-164, 2012. +Beck, A. First-order methods in optimization. SIAM, 2017. +Beygelzimer, A., Hazan, E., Kale, S., and Luo, H. Online gradient boosting. In Advances in neural information processing systems, pp. 2458-2466, 2015a. +Beygelzimer, A., Kale, S., and Luo, H. Optimal and adaptive algorithms for online boosting. In International Conference on Machine Learning, pp. 2323-2331, 2015b. +Brukhim, N. and Hazan, E. Online boosting with bandit feedback. arXiv preprint arXiv:2007.11975, 2020. +Brukhim, N., Chen, X., Hazan, E., and Moran, S. Online agnostic boosting via regret minimization, 2020. +Cesa-Bianchi, N., Freund, Y., Haussler, D., Helmbold, D. P., Schapire, R. E., and Warmuth, M. K. How to use expert advice. Journal of the ACM (JACM), 44(3):427-485, 1997. +Chen, S.-T., Lin, H.-T., and Lu, C.-J. An online boosting algorithm with theoretical justifications, 2012. +Chen, S.-T., Lin, H.-T., and Lu, C.-J. Boosting with online binary learners for the multiclass bandit problem. In International Conference on Machine Learning, pp. 342-350, 2014. +Dudik, M., Hsu, D., Kale, S., Karampatziakis, N., Langford, J., Reyzin, L., and Zhang, T. Efficient optimal learning for contextual bandits. arXiv preprint arXiv:1106.2369, 2011. +Friedman, J. H. Stochastic gradient boosting. Computational statistics & data analysis, 38(4):367-378, 2002. +Harrison Jr, D. and Rubinfeld, D. L. Hedonic housing prices and the demand for clean air. Journal of environmental economics and management, 5(1):81-102, 1978. + +Hazan, E. Introduction to online convex optimization. arXiv preprint arXiv:1909.05207, 2019. +Hazan, E. and Koren, T. The computational power of optimization in online learning. In Proceedings of the forty-eighth annual ACM symposium on Theory of Computing, pp. 128-141, 2016. +Hazan, E., Hu, W., Li, Y., and Li, Z. Online improper learning with an approximation oracle. In Advances in Neural Information Processing Systems, pp. 5652-5660, 2018. +Jung, Y. H. and Tewari, A. Online boosting algorithms for multi-label ranking. In International Conference on Artificial Intelligence and Statistics, pp. 279-287, 2018. +Jung, Y. H., Goetz, J., and Tewari, A. Online multiclass boosting. In Advances in neural information processing systems, pp. 919-928, 2017. +Kakade, S. M., Kalai, A. T., and Ligett, K. Playing games with approximation algorithms. SIAM Journal on Computing, 39(3):1088-1106, 2009. +Langford, J. and Zhang, T. The epoch-greedy algorithm for multi-armed bandits with side information. In Advances in neural information processing systems, pp. 817-824, 2008. +Leistner, C., Saffari, A., Roth, P. M., and Bischof, H. On robustness of on-line boosting-a competitive study. In IEEE 12th International Conference on Computer Vision Workshops, ICCV Workshops, pp. 1362-1369. IEEE, 2009. +Littlestone, N. and Warmuth, M. The weighted majority algorithm. Information and Computation, 108(2):212-261, 1994. +Olshen, R. A conversation with Leo Breiman. Statistical Science, 16(2):184-198, 2001. +Pace, R. K. and Barry, R. Sparse spatial autoregressions. Statistics & Probability Letters, 33(3):291-297, 1997. +Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournaepau, D., Brucher, M., Perrot, M., and Duchesnay, E. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830, 2011. +Rakhlin, A. and Sridharan, K. Bistro: An efficient relaxation-based method for contextual bandits. In ICML, pp. 1977-1985, 2016. +Schapire, R. E. and Freund, Y. Boosting: Foundations and Algorithms. Cambridge university press, 2012a. ISBN 9780262017183. doi: + +10.1017/CBO9781107415324.004. URL https://www.cambridge.org/core/product/identifier/CBO9781107415324A009/type/book_part. +Schapire, R. E. and Freund, Y. Boosting: Foundations and Algorithms. MIT Press, 2012b. +Shalev-Shwartz, S. et al. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 4(2):107-194, 2012. +Syrgkanis, V., Krishnamurthy, A., and Schapire, R. Efficient algorithms for adversarial contextual learning. In International Conference on Machine Learning, pp. 2159-2168, 2016a. +Syrgkanis, V., Luo, H., Krishnamurthy, A., and Schapire, R. E. Improved regret bounds for oracle-based adversarial contextual bandits. In Advances in Neural Information Processing Systems, pp. 3135-3143, 2016b. +Viola, P. and Jones, M. Rapid object detection using a boosted cascade of simple features. In Proceedings of the 2001 IEEE computer society conference on computer vision and pattern recognition. CVPR 2001, volume 1, pp. I-I. IEEE, 2001. \ No newline at end of file diff --git a/boostingforonlineconvexoptimization/images.zip b/boostingforonlineconvexoptimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f958b01f8bd10f3253425dcdc9b21e6033d4739b --- /dev/null +++ b/boostingforonlineconvexoptimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19d17cc38bbccab415eb8670d60a2f908b52b61d154c5b24d7c74a5193bb9d1a +size 492894 diff --git a/boostingforonlineconvexoptimization/layout.json b/boostingforonlineconvexoptimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2bb43fd7a12c9ea45ec324fdac0b0ac8f1ca7a33 --- /dev/null +++ b/boostingforonlineconvexoptimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:084ddd8bc18d32ad39e5cfb9213a33db300528b0ab1ae9994c1b8e568c2d4bed +size 589276 diff --git a/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_content_list.json b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6fa1ab2396f40c5e218e9fab54ecde38d2b02742 --- /dev/null +++ b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0def0a9ff462093173838c9886e5050bc19f708babafb17d54380211999b45ca +size 86019 diff --git a/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_model.json b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..eeeb4aca97d1b888044bd869f8a31033bf2ace89 --- /dev/null +++ b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579a40956fc5672119e4346a2c989738d925e24fdd2ab8c367ab28b827a227f4 +size 102902 diff --git a/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_origin.pdf b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bdf8c23ab55fa88b86bd1c2d30a0f180ab7ffc0a --- /dev/null +++ b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/0a64dd95-3de9-419b-87a9-27920769ffc3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0a76259c2f39f53d5d17b0d3cf23e50c3955cc8d48cf5224cee4ab050958064 +size 421525 diff --git a/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/full.md b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/full.md new file mode 100644 index 0000000000000000000000000000000000000000..187858b99c1262de85465beac646d5c7fdb4bf35 --- /dev/null +++ b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/full.md @@ -0,0 +1,321 @@ +# Boosting the Throughput and Accelerator Utilization of Specialized CNN Inference Beyond Increasing Batch Size + +Jack Kosaian $^{1*}$ Amar Phanishayee $^{2}$ Matthai Philipose $^{2}$ Debadeepta Dey $^{2}$ K. V. Rashmi $^{1}$ + +# Abstract + +Datacenter vision systems widely use small, specialized convolutional neural networks (CNNs) trained on specific tasks for high-throughput inference. These settings employ accelerators with massive computational capacity, but which specialized CNNs underutilize due to having low arithmetic intensity. This results in suboptimal application-level throughput and poor returns on accelerator investment. Increasing batch size is the only known way to increase both application-level throughput and accelerator utilization for inference, but yields diminishing returns; specialized CNNs poorly utilize accelerators even with large batch size. We propose FoldedCNNs, a new approach to CNN design that increases inference throughput and utilization beyond large batch size. FoldedCNNs rethink the structure of inputs and layers of specialized CNNs to boost arithmetic intensity: in FoldedCNNs, $f$ images with $C$ channels each are concatenated into a single input with $fC$ channels and jointly classified by a wider CNN. Increased arithmetic intensity in FoldedCNNs increases the throughput and GPU utilization of specialized CNN inference by up to $2.5 \times$ and $2.8 \times$ , with accuracy close to the original CNN in most cases. + +# 1. Introduction + +Convolutional neural networks (CNNs) are widely deployed for high-throughput vision tasks. Many such tasks target highly specific events for which general-purpose CNNs trained on diverse data (e.g., ResNet-50 on ImageNet) are overkill; an application detecting red trucks does not need a CNN capable of classifying animals. It has thus become popular to employ small specialized CNNs trained only for such focused tasks (Shen et al., 2017; Kang et al., 2017; + +*Work done in part as an intern at Microsoft Research. +1Carnegie Mellon University 2Microsoft Research. Correspondence to: Jack Kosaian . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +Hsieh et al., 2018; Kang et al., 2020). In being trained for highly specific tasks, specialized CNNs can typically be much smaller than general-purpose CNNs, and thus operate at higher application-level throughput (e.g., images/sec). + +Specialized CNNs are heavily used for inference in both datacenters and edge clusters (Kang et al., 2017; Hsieh et al., 2018; Mullapudi et al., 2019; Bhardwaj et al., 2020), and occasionally on constrained devices (e.g., cameras) (Canel et al., 2019). We focus on specialized CNNs used for high-throughput vision in datacenters/clusters. A popular usecase in this setting is offline video analytics, in which all video frames are processed by a specialized CNN, and only frames for which the specialized CNN is uncertain are processed by a slower, general-purpose CNN (Kang et al., 2017). The throughput of the specialized CNN is critical to that of the overall system, as all frames are processed by the specialized CNN and only a small fraction by the general-purpose CNN. + +Aiding the case for high-throughput CNNs, server-grade deep learning hardware accelerators offer unprecedented performance in FLOPs/sec, and thus are used for inference in datacenters (e.g., V100 and T4 GPUs, TPUs) and edge clusters (e.g., AWS Outposts and Azure Stack Edge with T4 GPUs). It is critical that these accelerators be highly utilized, with software running on an accelerator ideally achieving FLOPs/sec near the accelerator's theoretical peak FLOPs/sec. Given the high cost of accelerators and the operational costs incurred in deploying them (e.g., power) (Barroso et al., 2013), poorly utilizing an accelerator leads to a poor return on investment. Furthermore, underutilization results in suboptimal application-level throughput. + +However, current specialized CNNs significantly underutilize server-grade accelerators: we find that specialized CNNs used in production at Microsoft achieve less than $20\%$ of the peak FLOPs/sec of GPUs employed in datacenters, even with large batch sizes (which are common for high-throughput inference), and when using techniques that improve throughput, such as reduced precision (see Fig. 1). While specialized CNNs might better utilize weaker devices, we find that server-grade GPUs, such as V100 and T4, offer the highest cost-normalized throughput for the CNNs described above, motivating their deployment in production. + +![](images/a9ca9b8169e2567e68109b96fa0ce6a9c31a7581527be293257fcf4fcd720d40.jpg) +Figure 1. Utilization of production specialized CNNs (see §2.1) at various precisions and maximum batch size on a T4 GPU. Each bar is relative to the peak FLOPs/sec of the T4 in that precision. + +The main cause for the poor accelerator utilization of specialized CNNs is low arithmetic intensity: the ratio between the number of arithmetic operations performed by a computational kernel (i.e., FLOPs) and the number of bytes read from or written to memory by the kernel (Williams et al., 2009). As the bandwidth of performing arithmetic on accelerators is far higher than memory bandwidth (e.g., over $200 \times$ on T4 (NVIDIA, 2018)), a CNN with low arithmetic intensity incurs frequent memory stalls, leaving arithmetic units idle and underutilized. High arithmetic intensity is, thus, a prerequisite to high utilization. However, we will show in §2 that specialized CNNs have arithmetic intensities far lower than needed for peak utilization on accelerators. + +The arithmetic intensities of specialized CNNs must be increased to improve utilization of server-grade accelerators, but achieving this requires care: we show that common techniques that increase application-level throughput can reduce arithmetic intensity, while naive approaches to increasing arithmetic intensity reduce application-level throughput. + +Increasing the batch size over which inference is performed can increase arithmetic intensity, utilization, and application-level throughput by amortizing the cost of loading a CNN's weights from memory. However, doing so leads to diminishing returns in these quantities: for example, we show in §2 that specialized CNNs achieve at most $17\%$ of the peak FLOPs/sec of a V100 at large batch sizes. An alternative is needed to further improve the utilization and throughput of specialized CNNs beyond the limits of increasing batch size. + +We propose FoldedCNNs, a new approach to the design of specialized CNNs that boosts inference utilization and throughput beyond increasing batch size. We show that convolutional and fully-connected layers in specialized CNNs at large batch size can be transformed to perform an equal number of FLOPs, but with higher arithmetic intensity. Our key insight is that, once arithmetic intensity has plateaued due to increased batch size, reading/writing activations accounts for most of the memory traffic in specialized CNNs. We show that this memory traffic can be significantly reduced, while performing the same number of FLOPs, by jointly decreasing the size of the batch of input/output activations for a layer and increasing the layer's width. By decreasing memory traffic while performing the same number of FLOPs, this transformation increases arithmetic intensity. + +FoldedCNNs take a new approach to structuring the inputs + +![](images/45f4bf2a5154e08358790242f7604c4da57cc3cf042ead5e821fe30dd45a4fc6.jpg) +Figure 2. Abstract illustration of a FoldedCNN with $f = 2$ . + +of a CNN to apply this transformation, inspired in part from the interplay of machine learning and coding theory in other applications (Kosaian et al., 2020). As shown in Fig. 2, rather than operating over a batch of $N$ images each with $C$ channels, a FoldedCNN instead operates over a batch of $\frac{N}{f}$ "folded" inputs each with $fC$ channels formed by concatenating $f$ images along the channels dimension. These $f$ images are jointly classified: if the original CNN had $C_L$ output classes, the FoldedCNN now has $fC_L$ output classes. FoldedCNNs increase the number of channels for all middle layers by $\sqrt{f}\times$ , while maintaining an $f\times$ reduction in batch size. This reduces memory traffic over $N$ images by $\sqrt{f}\times$ while performing a similar number of FLOPs, thus increasing arithmetic intensity, utilization, and throughput. + +We evaluate FoldedCNNs on four specialized CNNs used at Microsoft and four from the NoScope video-processing system (Kang et al., 2017). FoldedCNNs improve the GPU utilization of specialized CNNs by up to $2.8 \times$ and throughput by up to $2.5 \times$ , while maintaining accuracy close to the original CNN in most cases. Compared to the compound scaling used in EfficientNets (Tan & Le, 2019), FoldedCNNs achieve higher accuracy, throughput, and utilization for specialized CNNs. These results show the promise of FoldedCNNs in increasing the utilization and throughput of specialized CNNs beyond increased batch size, and open doors for future high-performance specialized CNNs. The code used in this paper is available at https://github.com/msr-fiddle/folded-cnns. + +# 2. Challenges in Achieving High Utilization + +We now describe challenges in achieving high accelerator utilization in specialized CNN inference. + +# 2.1. Specialized CNNs + +As described in §1, specialized CNNs are small CNNs designed to target highly specific visual tasks and to achieve higher throughput than large, general-purpose CNNs. We focus on two motivating usecases of specialized CNNs: + +Usecase 1: filters. A popular use of specialized CNNs is as lightweight filters in front of slower, general-purpose CNNs. In such systems, all video frames/images pass through a specialized CNN, and are processed by the general-purpose CNN only if the specialized CNN is uncertain (Kang et al., + +Table 1. Specialized CNNs used in this work. + +
GroupIDNameResol.Convs.Classes
NoScopeN1coral(50, 50)22
N2night(50, 50)22
N3roundabout(50, 50)42
N4tapei(50, 50)22
MicrosoftV1lol-gold1(22, 52)511
V2apex-count(19, 25)522
V3sot-coin(17, 40)515
V4sot-time(22, 30)827
+ +Table 2. Parameters of a 2D convolution with stride of 1. + +
Parameter(s)Variable(s)
batch sizeN
output height, widthH, W
input, output channelsCi, Co
conv. kernel height, widthKH, Kw
+ +2017). In other cases, the specialized CNN builds an approximate index to accelerate later ad-hoc queries by a general CNN (Hsieh et al., 2018). These applications desire high throughput, so batching is heavily exploited. We use specialized CNNs from the NoScope video-processing system (Kang et al., 2017) as examples of this usecase. + +Usecase 2: game scraping. We also consider specialized CNNs used in production at Microsoft to classify events in video game streams by scraping in-game text appearing in frames (e.g., score). Separate CNNs are specialized for each game and event type. The service handles thousands of streams at once, and thus heavily batches images. + +Comparison of general and specialized CNNs. General-purpose CNNs, such as those used for ImageNet, have many convolutional layers, each with many channels. For example, ResNet-50 has 49 convolutional layers, each with 64–2048 channels. In contrast, specialized CNNs have far fewer layers and channels: the specialized CNNs used in NoScope (Usecase 1) have 2–4 convolutional layers, each with 16–64 channels; those used at Microsoft (Usecase 2) have 5–8 convolutional layers with at most 32 channels. Further details on these CNNs are given in Table 1 and §A. + +# 2.2. High utilization requires high arithmetic intensity + +As described in §1, achieving high utilization of accelerators is critical for operational efficiency. Ideally, a CNN would operate near the peak FLOPs/sec offered by an accelerator. However, achieving this is confounded by the need to transfer data to/from memory, as cycles stalled on memory are wasted if they cannot be masked by computation. + +A computational kernel must be compute bound to achieve peak FLOPs/sec: a compute-bound kernel uses all arithmetic units on an accelerator at all times. Under the popular Roofline performance model (Williams et al., 2009), a kernel can only be compute bound if it theoretically spends + +more time computing than it does reading/writing memory: + +$$ +\frac {\text {F L O P s}}{\text {C o m p u t e B a n d w i d t h}} > \frac {\text {B y t e s}}{\text {M e m o r y B a n d w i d t h}} +$$ + +Here, "FLOPs" is the number of arithmetic operations performed, "Bytes" is the amount of data transferred to/from memory (memory traffic), "Compute Bandwidth" is the accelerator's peak FLOPs/sec, and "Memory Bandwidth" is the accelerator's memory bandwidth (bytes/sec). Rearranging this to pair properties of the kernel on the left-hand side and properties of the accelerator on the right-hand gives: + +$$ +\frac {\text {F L O P s}}{\text {B y t e s}} > \frac {\text {C o m p u t e B a n d w i d t h}}{\text {M e m o r y B a n d w i d t h}} \tag {1} +$$ + +The left-hand ratio of Eqn. 1 is termed “arithmetic intensity”: the ratio between the FLOPs performed by the kernel and the bytes it transfers to/from memory. The arithmetic intensity of a given layer in a CNN is (abstractly) written as: + +$$ +\frac {\text {F L O P s}}{\text {I n p u t b y t e s} + \text {W e i g h t b y t e s} + \text {O u t p u t b y t e s}} \tag {2} +$$ + +where "Input bytes" is the size of the layer's input activations, "Output bytes" is the size of output activations written by the layer to memory for processing by the next layer, and "Weight bytes" is the size of the layer's weights. For example, using the terminology in Table 2, the arithmetic intensity of a 2D convolutional layer with a stride of 1 is: + +$$ +\frac {2 N H W C _ {o} C _ {i} K _ {H} K _ {W}}{B \left(N H W C _ {i} + C _ {i} K _ {H} K _ {W} C _ {o} + N H W C _ {o}\right)} \tag {3} +$$ + +where $B$ is numerical precision in bytes (e.g., 2 for FP-16). The aggregate arithmetic intensity of a CNN as a whole is computed by summing the FLOPs performed by each layer of the CNN, summing the bytes read/written by each layer, and dividing these quantities. This accounts for optimizations like layer fusion that reduce memory traffic. + +Eqn. 1 indicates that, for a kernel to achieve the peak FLOPs/sec of an accelerator, the kernel's arithmetic intensity must be higher than the ratio between the accelerator's compute bandwidth and memory bandwidth (Williams et al., 2009). For example, this ratio is 139 in half-precision on a V100 GPU (NVIDIA), 203 on a T4 GPU (NVIDIA, 2018), and 1350 on TPUv1 (Jouppi et al., 2017). It is often necessary for arithmetic intensity to be far higher than this ratio, as arithmetic intensity calculations typically assume perfect memory reuse, which can be difficult to achieve in practice. + +Specialized CNNs have low arithmetic intensity. While high arithmetic intensity is needed for high utilization of + +accelerators, specialized CNNs have low arithmetic intensity due to their small sizes. For example, the half-precision arithmetic intensities of the CNNs used in the game-scraping tasks are 88–102 at large batch sizes, much lower than the minimum of 139 required for peak utilization of a V100 GPU, which is used for specialized CNN inference in datacenters (Mullapudi et al., 2019). Thus, these CNNs achieve at most $17\%$ of the V100's peak FLOPs/sec, even at large batch sizes and when running on the TensorRT inference library that performs optimizations like layer fusion. To improve their utilization of accelerators, specialized CNNs must be modified to increase arithmetic intensity. + +As described above, high arithmetic intensity alone is insufficient to achieve high utilization, as implementations must efficiently use accelerator resources (e.g., memory hierarchy). Nevertheless, high arithmetic intensity is a prerequisite for high utilization. For specialized CNNs, increasing arithmetic intensity is thus necessary to increase utilization. We will show that simply increasing arithmetic intensity greatly increases the utilization and throughput of specialized CNN inference atop an optimized inference library. + +# 2.3. Improving arithmetic intensity is non-trivial + +To increase the arithmetic intensity of convolutional and fully-connected layers, one must increase the ratio in Eqn. 2. For concreteness, we focus on convolutional layers in this subsection, and thus on increasing Eqn. 3. + +Low precision? One way to increase Eqn. 3 is to decrease numerical precision $B$ , which reduces memory traffic by representing operands/outputs using fewer bits. However, modern accelerators have compute units that offer increased FLOPs/sec in low precision (e.g., T4 GPUs). Reducing precision thus increases both the left-hand side of Eqn. 1 (by reducing bytes) and the right-hand side (by increasing compute bandwidth). When these quantities change at equal rates, as is common in accelerators (NVIDIA, 2018), the inequality remains the same: kernels that did not satisfy this inequality at a high precision will not satisfy it at low precision. Fig. 1 illustrates this on a T4 GPU: specialized CNNs have low utilization at both full (FP-32) and low precisions (FP-16, INT-8). Thus, while reducing precision can accelerate inference, it does not increase utilization. + +Large batch size? Increasing batch size $N$ can increase arithmetic intensity by amortizing the cost of loading layer weights. However, doing so leads to diminishing returns in arithmetic intensity $(A)$ , as (ignoring $B$ in Eqn. 3): + +$$ +\begin{array}{l} A = \frac {2 N H W C _ {o} C _ {i} K _ {H} K _ {W}}{N H W C _ {i} + C _ {i} K _ {H} K _ {W} C _ {o} + N H W C _ {o}} \\ \lim _ {N \rightarrow \infty} A = \frac {2 C _ {o} C _ {i} K _ {H} K _ {W}}{C _ {i} + C _ {o}} \tag {4} \\ \end{array} +$$ + +When batch size is large enough that arithmetic intensity is determined by Eqn. 4, we say that a layer is in the "batch- + +![](images/88e935a0e1757db3faa6c118f2aad56cd8b638020c6b517c956767d6ad03a642.jpg) +Figure 3. FP-16 utilization and arithmetic intensity of gamescraping CNNs on a V100 GPU. The dashed line is the minimum arithmetic intensity needed for peak utilization of a V100 GPU. + +limited regime." Fig. 3 shows this on the game-scraping CNNs: arithmetic intensity and utilization plateau with large batch size at $17\%$ of the peak FLOPs/sec of a V100. + +To further increase arithmetic intensity beyond the limits of increased batch size, Eqn. 4 indicates that one must increase $C_i$ , $C_o$ , $K_H$ , or $K_W$ . However, doing so increases the number of FLOPs performed by the layer per image, which typically decreases application-level throughput. + +Takeaway. To increase utilization beyond increasing batch size, while maintaining high throughput, one must increase arithmetic intensity without greatly increasing FLOP count. We next propose techniques to achieve this goal. + +# 3. Boosting Intensity via Folding + +We now propose transformations to increase the arithmetic intensity of layers of specialized CNNs operating over large batches without increasing FLOPs. For clarity, we focus on convolutional layers, though the transformations also apply to fully-connected layers (as will be shown in §4). + +To increase arithmetic intensity while performing the same number of FLOPs, one must decrease memory traffic, the denominator in Eqn. 3. Our key insight is that the total memory traffic of specialized CNNs with large batch size is dominated by reading/writing the input/output activations of convolutional and fully-connected layers $(NHWC_{i}$ and $NHWC_{o}$ in the denominator of Eqn. 3), rather than by reading layer weights $(C_iK_HK_WC_o)$ . Figs. 4 and 5 (focus only on blue parts) depict this for one CNN: with batch size 1024, activations make up over $99\%$ of total memory traffic. + +Due to the dominance of input/output activations on a layer's total memory traffic, we note that a joint decrease in $NHW$ and increase in $C_i K_H K_W C_o$ can reduce memory traffic while maintaining the same number of FLOPs. Suppose one decreased $NHW$ by a factor of $f$ (with $f > 1$ ) and increased $C_i$ and $C_o$ by a factor of + +![](images/6778fd4db74f62d9c3c987e4166cb26d57724f331fae4a876359f179f162e9da.jpg) +Figure 4. Memory traffic of activations and weights of the N1 and folded $(f = 4)$ CNN. Axes are in log scale. The y-axis is in elements, rather than bytes, as the trends hold for any bitwidth. + +![](images/b94bbc1d36e6bbf22d255f540658d9d92bcc788fc08902b96630fed8694e3a17.jpg) +Figure 5. Total memory traffic of the N1 and folded $(f = 4)$ CNN. As shown in the inset, weights account for a minor fraction of memory traffic with large batch size. The y-axis is in elements, rather than bytes, as the trends hold for any bitwidth used. + +$\sqrt{f}$ . We call this transformation folding and layers transformed by it folded. The folded layer has the following properties: (1) It performs the same number of FLOPs: $\frac{NHW}{f} (C_o\sqrt{f})(C_i\sqrt{f})(K_H K_W) = NHWC_o C_i K_H K_W$ . (2) It decreases the size of layer inputs/outputs by a factor of $\sqrt{f}$ from $NHWC_i$ to $\frac{\sqrt{f}}{f} NHWC_i$ (similarly for outputs with $C_o$ ). (3) It increases the number of layer weights by a factor of $f$ from $C_i K_H K_W C_o$ to $(C_i\sqrt{f})K_H K_W(C_o\sqrt{f})$ . + +Properties 2 and 3 are shown in Fig. 4 when folding a representative specialized CNN from the NoScope system with $f = 4$ : the folded convolutions have $2 \times$ lower memory traffic for activations and $4 \times$ higher memory traffic for weights. At large batch sizes, the decrease in memory traffic for activations is larger than the increase for weights. For example, at batch size 1024, memory traffic for activations decreases by 66.7M, while that for weights increases by only 3.9M. The increase in memory traffic from layer weights is dwarfed by the decrease for activations, resulting in a reduction in total memory traffic. Fig. 5 illustrates this reduction in memory traffic for the same CNN. We analytically show when this reduction in memory traffic will occur in §J. + +As the folded layer performs as many FLOPs as the original layer, but with reduced memory traffic, it has higher arithmetic intensity. If a layer is in the batch-limited regime, in which arithmetic intensity is determined by Eqn. 4, folding increases arithmetic intensity by $\sqrt{f} \times$ , as the numerator and denominator in Eqn. 4 increase by $f \times$ and $\sqrt{f} \times$ , respectively. An example of this is shown in §B. + +![](images/4454715e1e53145353ff6d59164af94addaf6b4584675a33443e709196fd18be.jpg) +Figure 6. Middle layer of a FoldedCNN with $f = 4$ . Both the number of input and output channels increase by a factor of $\sqrt{f}$ . + +When does folding help? Folding will most heavily increase the utilization and throughput of layers that have arithmetic intensity in the batch-limited regime that is below that needed for peak FLOPs/sec on an accelerator. Specialized CNNs are thus ideal targets for folding, as they have low arithmetic intensity even at large batch size. Meanwhile, large CNNs or those with small batch size are less likely to benefit. Thus, we focus on folding specialized CNNs. + +# 4. FoldedCNNs + +We now propose FoldedCNNs, a new approach CNN design based on the folding transformation proposed in §3. + +Folding involves (1) decreasing $NHW$ by $f \times$ and (2) increasing $C_i K_H K_W C_o$ by $f \times$ . There are many ways to achieve these effects. FoldedCNNs achieve them by (1) decreasing batch size $N$ by $f \times$ , (2) increasing the number of input and output channels $C_i$ and $C_o$ each by $\sqrt{f} \times$ . We do not reduce resolution $(H, W)$ or increase receptive field $(K_H, K_W)$ , as specialized CNNs often operate over small images to begin with (Kang et al., 2017); we find that such changes can decrease accuracy compared to FoldedCNNs. + +# 4.1. Applying folding to a full CNN + +We now describe folding for a specialized CNN with $L$ convolutional/fully-connected layers and $C_L$ classes. Let $C_{i,l}$ denote the number of input channels to layer $l$ of the original CNN, and $C_{i,l}^{\prime}$ that in the FoldedCNN. Similar notation is used for all parameters in Table 2. While we focus on plain convolutions in this section, FoldedCNNs also apply to other convolutional variants. We evaluate folding for group convolutions in $\S C$ and Winograd convolutions in $\S D$ . + +We first transform a layer $l$ in the middle of the CNN, as shown in Fig. 6. As described above, FoldedCNNs decrease batch size: $N' = \frac{N}{f}$ and increase the number of input and output channels: $C_{i,l}' = C_{i,l}\sqrt{f}$ and $C_{o,l}' = C_{o,l}\sqrt{f}$ . Folded fully-connected layers in the middle of the CNN also have $\sqrt{f} \times$ the number of input and output features. As folding is applied to all convolutional and fully-connected layers, the increase in output channels in one layer naturally fits the increase in input channels for the next layer. + +Folding batches of images. As described in §3, each layer in a FoldedCNN performs the same number of FLOPs as the corresponding layer of the original CNN. However, a + +![](images/cc0e00d16be476231352bcbb9dc94b90d14af5651f9a8b055d52c67c1861df3b.jpg) +Figure 7. First layer of a FoldedCNN with $f = 4$ . Unlike other layers, this layer increases input channels by a factor of $f$ . + +![](images/9617f364fbc959d02fe73f6015ff8846c30fbed25fcb125f79cbbac583b547cf.jpg) +Figure 8. Output layer of a FoldedCNN with $f = 4$ and 2 classes. Unlike other layers, this layer has $f \times$ the number of outputs. + +FoldedCNN performs these FLOPs over $\frac{N}{f}$ images, whereas the original CNN operates over $N$ images. Left uncorrected, FoldedCNNs would thus perform $f \times$ more FLOPs per image, and thus would reduce application-level throughput. + +To rectify this, FoldedCNNs "fold" a batch of images into "stacks" of images, as shown in Figs. 2 and 7. Suppose the original CNN takes in $N$ images each with $C_{i,1}$ channels (e.g., $C_{i,1} = 3$ for RGB). A FoldedCNN instead takes in $\frac{N}{f}$ inputs each with $C_{i,1}f$ channels, formed by concatenating $f$ images along the channels dimension. Each folded input represents $f$ images, so the number of images in a batch of $\frac{N}{f}$ such inputs is equal to that of the original CNN ( $N$ ). As a FoldedCNN performs inference over $f$ images in a single input, it must return classification results for $f$ images. To accommodate this, the output layer of a FoldedCNN produces outputs for $fC_L$ classes, $C_L$ for each of the $f$ images stacked in a single input. This is illustrated in Fig. 8. + +These adjustments result in the first and last layers of FoldedCNNs performing slightly more FLOPs than those of the original CNN. The first layer of a FoldedCNN sets $C_{i,1}^{\prime} = C_{i,1}f$ , whereas other layers have $C_{i,l}^{\prime} = C_{i,l}\sqrt{f}$ . As the number of output channels in the first layer is also increased by $\sqrt{f} \times$ , the first layer performs $\sqrt{f} \times$ more FLOPs than the original first layer (see Fig. 7). This is also the case for the last layer of the FoldedCNN due to returning predictions for $f$ images (see Fig. 8). All other layers in the FoldedCNN perform the same number of FLOPs as those in the original CNN, as described previously. Despite this slight increase in FLOPs, §5 will show that FoldedCNNs, in fact, achieve higher throughput than the original CNN due to their increased arithmetic intensity. + +# 4.2. Training a FoldedCNN + +Training a FoldedCNN is similar to training the original CNN. Let $N_{T}$ denote the training batch size. Each training iteration, $N_{T}$ images are sampled and transformed into $\frac{N_{T}}{f}$ folded inputs as described above. A forward pass through the FoldedCNN results in an output of size $\frac{N_{T}}{f} \times fC_{L}$ , as shown in Fig. 8. This output is reshaped to be of size $N_{T} \times C_{L}$ , and loss is computed on each of the $N_{T}$ rows. + +As each folded input consists of $f$ images, and each image belongs to one of $C_L$ classes, the effective number of classes for a FoldedCNN is $C_L^f$ . This large increase in the number of classes can make it difficult to train a FoldedCNN for tasks with many classes to begin with. To combat this issue, we use a form of curriculum learning (Bengio et al., 2009) specialized for FoldedCNNs. Training begins by sampling from only $I < C_L$ classes of the original CNN's dataset, and introducing $\Delta$ more classes every $E$ epochs. We hypothesize that starting with a small number of classes $I$ avoids overloading the FoldedCNN with a difficult task early on in training, as $I^f \ll C_L^f$ . We find this form of training beneficial when $C_L$ and $f$ are large, and it yielded only marginal improvements in other settings. + +# 5. Evaluation + +# 5.1. Evaluation setup + +We consider CNNs and tasks from the usecases described in §2.1: specialized CNNs from NoScope $^4$ as lightweight filters, and specialized CNNs from Microsoft. Each task and CNN is described in detail in §A. While the focus of this work is on specialized CNNs, we also evaluate on the more general ResNet-18 on CIFAR-10 and CIFAR-100. + +We evaluate FoldedCNNs with $f$ of 2, 3, and 4, which increase the channels per layer by factors of roughly 1.41, 1.73, and 2, respectively $(\sqrt{f} \times)$ . We compare FoldedCNNs to the compound scaling used in EfficientNets in §5.3. + +Training setup. When training FoldedCNNs, we randomly assign images from the training set into groups of size $f$ each epoch. Test sets are formed by randomly placing images from the test data into groups of $f$ . Such randomization at test time avoids simpler settings, such folding $f$ sequential frames in a video, thus providing a challenging scenario for FoldedCNNs. We also evaluate the sensitivity of FoldedCNNs to the order in which images are folded in §5.3. + +We train all CNNs using cross entropy loss. Training takes place for 50 epochs with batch size of 128 for the No-Scope tasks and for 1500 epochs with batch size of 32 for + +![](images/1c9423082afb270b0127ba34f2d70fb2dd749abe59d54d82d6f9afaab8f434ab.jpg) +(a) Specialized CNNs use in NoScope + +![](images/f4e93bbbb9baf055681e2f1a7a6bad187b07983d58d892a5d8afe15126b5bed2.jpg) +(b) Specialized CNNs used at Microsoft +Figure 9. Inference performance of FoldedCNNs relative to the original CNN. Arithmetic intensity is plotted in absolute numbers, and the dashed line shows the minimum arithmetic intensity required to reach peak FLOPs/sec on a V100 GPU. + +the game-scraping tasks. We use the curriculum learning in §4.2 for FoldedCNNs only on the game-scraping tasks. For these scenarios that use curriculum learning, we use $I = \max(f, \lfloor C_L / 10 \rfloor)$ , $\Delta = \lfloor C_L / 10 \rfloor$ , and $E = 60$ . Such curriculum learning did not improve the accuracy of the original CNN. We use hyperparameters from NoScope (Kang et al., 2017) to train NoScope CNNs: RMSprop with learning rate $6.6 \times 10^{-4}$ and Dropout of 0.25 after the second layer and before the last layer. All other models use Adam with learning rate $10^{-4}$ and weight decay of $10^{-5}$ . + +Inference setup. We evaluate inference on a V100 GPU (p3.2xlarge AWS instance), which is typical of hardware used for specialized CNN inference in datacenters (Mullapudi et al., 2019). We also evaluate on T4 GPUs, which are common both in datacenters and edge clusters. As results on V100 and T4 are similar, we relegate results on T4 to §E. Inference is performed in PyTorch with TensorRT (NVIDIA, 2021) on CUDA 10.2. While FoldedCNNs can improve utilization for any numerical precision, we use half precision (FP-16) to use Tensor Cores, which offer the peak FLOPs/sec on the V100 (NVIDIA, 2017). We report utilization (FLOPs/sec) and application-level throughput (images/sec) relative to the original CNN via the mean of 10 trials of 10000 inferences of batch size 1024. We use other batch sizes in §F. We call relative throughput "speedup." + +# 5.2. Evaluation on specialized CNNs used in NoScope + +Utilization and throughput. Fig. 9a shows the speedup and FLOPs/sec of FoldedCNNs relative to the original CNN, and the arithmetic intensity of each CNN. FoldedCNNs increase FLOPs/sec by up to $2.8 \times$ and throughput by up to $2.5 \times$ . Increased throughput speeds up tasks like offline analytics, while increased utilization enables higher throughput + +on a single accelerator and a better return on investment for deploying accelerators. FoldedCNNs match the $\sqrt{f} \times$ theoretical increase in arithmetic intensity described in §3, thus increasing utilization and throughput with higher $f$ . + +FoldedCNNs result in larger improvements in utilization and throughput for the N1 and N2 CNNs (up to $2.8 \times$ ) than for the N3 and N4 CNNs (up to $1.76 \times$ ). This can be explained by arithmetic intensity: the N1 and N2 CNNs originally have very low arithmetic intensity. FoldedCNNs bring this arithmetic intensity much closer to that needed for peak performance on the V100 GPU, resulting in significantly higher utilization and throughput. In contrast, both N3 and N4 already have arithmetic intensity above the minimum needed for peak utilization, leaving less room for improvement. Despite this lower potential, FoldedCNNs still deliver up to $1.76 \times$ higher utilization and throughput for these CNNs. + +There is only one case in which FoldedCNNs decrease throughput/utilization (N4, $f = 2$ ). This is due to tile quantization on NVIDIA GPUs, which we describe in §H. + +Accuracy. Table 3 shows the accuracy of FoldedCNNs on the NoScope tasks. FoldedCNNs maintain high accuracy: the accuracy of FoldedCNNs with $f = 2$ is, in fact, higher than that of the original CNN for three of CNNs, and only $0.18\%$ lower on the fourth. For these cases, FoldedCNNs provide up to a $1.39 \times$ speedup with the same accuracy. + +As $f$ increases, a FoldedCNN classifies more images per input, making the task of the FoldedCNN more challenging. As shown in Table 3 and Fig. 9a, increasing $f$ reduces accuracy but increases utilization and throughput, introducing a tradeoff that can be spanned based on the requirements of applications. We analyze an example of this tradeoff in §G. + +Table 3. Accuracy and speedup of FoldedCNNs for NoScope CNNs. Differences in accuracy are listed in parentheses. + +
ModelOriginal AccuracyFoldedCNN (f = 2)FoldedCNN (f = 3)FoldedCNN (f = 4)
AccuracySpeedupAccuracySpeedupAccuracySpeedup
N198.8298.64 (-0.18)1.3998.35 (-0.47)1.8597.93 (-0.89)2.51
N296.9696.99 (0.03)1.3896.93 (-0.03)1.8596.75 (-0.21)2.50
N394.8494.95 (0.11)1.0794.82 (-0.02)1.3794.72 (-0.12)1.76
N491.6691.91 (0.25)0.9091.39 (-0.27)1.0791.21 (-0.45)1.41
+ +Table 4. Performance of FoldedCNNs on production game-scraping tasks. Differences in accuracy are listed in parentheses. + +
ModelResolutionClassesOriginal AccuracyFoldedCNN (f = 2)FoldedCNN (f = 3)FoldedCNN (f = 4)
AccuracySpeedupAccuracySpeedupAccuracySpeedup
V1(22, 52)1197.6497.64 (0.00)1.1397.18 (-0.46)1.3895.27 (-2.37)1.75
V2(19, 25)2293.4592.09 (-1.36)1.1590.00 (-3.45)1.4489.91 (-3.54)1.74
V3(17, 40)1598.5097.43 (-1.07)1.1597.20 (-1.30)1.4396.87 (-1.63)1.71
V4(22, 30)2796.5296.52 (0.00)1.2296.00 (-0.52)1.4094.41 (-2.11)1.67
+ +Table 5. FoldedCNNs and EfficientNet compound scaling on gamescraping tasks. Speedup, utilization ("Util.), and arithmetic intensity ("A.I.") are relative to the original CNN. + +
ModelModeHigher values are better
AccuracySpeedupUtil.A.I.
V1EfficientNet93.27%1.320.830.91
Fold (f = 4)95.27%1.751.952.16
V2EfficientNet84.91%1.510.800.88
Fold (f = 4)89.91%1.741.932.15
V3EfficientNet96.40%1.460.750.87
Fold (f = 4)96.87%1.711.912.16
V4EfficientNet95.19%1.340.830.91
Fold (f = 3)96.00%1.401.461.78
Fold (f = 4)94.41%1.671.802.10
+ +# 5.3. Evaluation on production game-scraping CNNs + +Fig. 9b shows the utilization, throughput, and arithmetic intensity of FoldedCNNs on the production game-scraping tasks. FoldedCNNs increase FLOPs/sec by up to $1.95 \times$ and throughput by up to $1.75 \times$ compared to the original CNN. Table 4 shows that FoldedCNNs have accuracy drops of $0 - 1.36\%$ , $0.46 - 3.45\%$ , and $1.63 - 3.54\%$ with $f$ of 2, 3, and 4 on these tasks. These drops are larger than those on the NoScope tasks due to the higher number of classes in the game-scraping tasks. While the NoScope tasks have only two classes, the game-scraping tasks have 11-27 classes. Thus, lower accuracy on the game-scraping tasks is expected from FoldedCNNs. That said, FoldedCNNs still enable large improvements, such as a $1.22 \times$ speedup with no accuracy loss for V4 with $f = 2$ . + +Effect of image order. As FoldedCNNs jointly classify $f$ distinct images concatenated over the channels dimension, a natural question is how sensitive FoldedCNNs are to the order in which images are folded. To investigate this, we measure how often the predictions made by FoldedCNNs for each image match for all $f!$ permutations of $f$ images folded together (e.g., how often do predictions for image $X_{1}$ match in folded inputs $(X_{1}, X_{2})$ and $(X_{2}, X_{1})$ for $f = 2$ ). + +With $f$ of 2, 3, and 4, the average percentage of matching predictions for all $f!$ permutations on the V1 task is $98.8\%$ , $98.4\%$ , and $98.0\%$ , showing high invariance to image order. + +Comparison to EfficientNet scaling. We next compare FoldedCNNs to the techniques used in EfficientNets (Tan & Le, 2019). EfficientNets trade FLOPs and accuracy by jointly scaling the number of layers, the width, and the input resolution of a CNN. While such scaling can increase throughput by reducing FLOP count, reducing FLOP count in this manner can also decrease arithmetic intensity and utilization. To illustrate this, we transform the game-scraping CNNs with EfficientNet compound scaling6 with the recommended parameters from the EfficientNet paper (Tan & Le, 2019): using terminology from the paper, $\phi = -1$ , $\alpha = 1.1$ , $\beta = 1.2$ , and $\gamma = 1.15$ . This transforms a CNN to perform roughly $2\times$ fewer FLOPs, which increases throughput. + +Table 5 compares FoldedCNNs and EfficientNets on the game-scraping CNNs. For each task, a FoldedCNN achieves both higher accuracy and throughput than the EfficientNet variant. For example, for V1, a FoldedCNN has $2\%$ higher accuracy and $33\%$ higher throughput than the EfficientNet variant. Furthermore, whereas EfficientNets reduce arithmetic intensity and utilization for all CNNs due to decreased FLOP count, FoldedCNNs uniformly increase arithmetic intensity and utilization. These results show the promise of the new approaches proposed in FoldedCNNs targeted specifically for large-batch, specialized CNN inference. + +# 5.4. FoldedCNNs in non-target settings + +As described in §3, our focus in FoldedCNNs is on small CNNs with low arithmetic intensity even at large batch size, and specialized tasks with few classes. For completeness, we now evaluate FoldedCNNs on general-purpose CNNs and tasks, which are not in this target regime. We also evaluate small CNNs for tasks with many classes in §I. + +Accuracy on general tasks. To evaluate the accuracy of FoldedCNNs on general-purpose tasks, we consider ResNet-18 FoldedCNNs on CIFAR-10 and CIFAR-100. + +For CIFAR-10, we train a FoldedCNN with $f = 4$ via distillation with the original CNN as the "teacher" (Ba & Caruana, 2014). The original ResNet-18 has an accuracy of $92.98\%$ , while the FoldedCNN has an accuracy of $92.10\%$ . This small accuracy drop even with high $f$ shows the potential applicability of FoldedCNNs to general-purpose tasks. + +For CIFAR-100, we do not observe benefit from the same distillation used for CIFAR-10. The original ResNet-18 on CIFAR-100 achieves $70.3\%$ accuracy, while FoldedCNNs have accuracies of $68.11\%$ (2.19% drop), $67.44\%$ (2.86% drop), and $65.76\%$ (4.54% drop) with $f$ of 2, 3, and 4. These larger drops compared to CIFAR-10 can be attributed to the higher number of classes in CIFAR-100, which makes the task of a FoldedCNN more challenging (see §4.2). + +Speedup on general CNNs. We now evaluate the speedup of FoldedCNNs when the original CNN is the general-purpose ResNet-18 operating on CIFAR-10. A FoldedCNN with $f = 4$ in this setup improves throughput by $8.1\%$ . This speedup is smaller than those observed in Fig. 9 because ResNet-18 has arithmetic intensity of 430, much higher than the minimum needed for peak FLOPs/sec on a V100 (139). This places ResNet-18 outside the target regime of FoldedCNNs. FoldedCNNs still do provide $8.1\%$ speedup, as $24\%$ of the layers in ResNet-18 have low arithmetic intensity. + +Takeaway. Coupling these moderate benefits in non-target settings with large benefits in target settings, FoldedCNNs show promise for increasing the utilization and throughput of specialized CNN inference beyond increased batch size. + +# 6. Related Work + +Efficient neural architectures. There is a large body of work on designing CNNs for efficient inference (e.g., (Ma et al., 2018; Cai et al., 2018; Zhou et al., 2018; Wu et al., 2019; Tan & Le, 2019; Cai et al., 2020)). Many of these works aim to reduce latency, but often do not consider accelerator utilization, which is a primary objective of FoldedCNNs. Some of these approaches, such as EfficientNets (Tan & Le, 2019), reduce the number of FLOPs performed by a CNN to achieve lower latency. However, we show in §5 that doing so can, in fact, reduce accelerator utilization. Furthermore, compared to these approaches, FoldedCNNs employ a fundamentally new structure to CNN inputs and classification, which could be integrated into existing architecture search techniques. Finally, FoldedCNNs are designed primarily for large-batch, specialized CNN inference, whereas existing works typically target general-purpose CNNs. + +Improving throughput. Many other techniques have been proposed to accelerate inference, but which do not target + +utilization. Network pruning (Blalock et al., 2020) can improve throughput by reducing the FLOP count of a CNN, but, similar to the approaches described above, can reduce utilization. Reducing the numerical precision used during inference can increase throughput (Wang, 2019), but is insufficient for increasing utilization on modern accelerators (as we show in §2.3). Folding can be applied on top of these techniques to further improve the utilization and throughput of specialized CNN inference. In fact, our evaluation in §5 applies FoldedCNNs atop low-precision specialized CNNs. + +Multitenancy. There is a growing body of work on increasing accelerator utilization by performing inference for multiple models on the same device (Narayanan et al., 2018; Jain et al., 2018; Shen et al., 2019; Yu & Chowdhury, 2020; Dhakal et al., 2020). These works do not improve the utilization of individual models, which is the goal of FoldedCNNs. Thus, these works are complementary to FoldedCNNs. + +# 7. Conclusion + +Specialized CNNs are widely used for high-throughput inference, but greatly underutilize accelerators, even when using large batch sizes. FoldedCNNs are a new approach to CNN design that increase the utilization and throughput of specialized CNN inference beyond increased batch size. FoldedCNNs increase arithmetic intensity by operating over distinct images concatenated along the channels dimension and increasing CNN width. Increased arithmetic intensity in FoldedCNNs boosts the utilization and throughput of specialized CNNs by up to $2.8 \times$ and $2.5 \times$ . + +FoldedCNNs are not a panacea: their design is driven by the specific setting of specialized CNNs that operate over large batches, and that run on accelerators that require high arithmetic intensity to reach peak utilization. As our evaluation showed, FoldedCNNs provide only modest benefits outside this setting. Nevertheless, this work shows the increase in utilization and throughput made possible by substantially rethinking specialized CNN design. As the arithmetic intensity required to reach peak utilization on accelerators increases, FoldedCNNs may show promise in running today's general-purpose CNNs on tomorrow's accelerators. + +# Acknowledgements + +We thank the anonymous reviewers and the area chair from ICML 2021, our colleagues at MSR, and CMU's Parallel Data Lab members for feedback that improved this work. We thank MSR for generously supporting Jack's internship work. Jack was also funded in part by an NSF Graduate Research Fellowship (DGE-1745016 and DGE-1252522). Jack and Rashmi were also funded in part by Amazon Web Services and in part by the AIDA project (POCI-01-0247-FEDER-045907) co-financed by the European Regional Development Fund through the Operational Program for Competitiveness and Internationalisation 2020. + +# References + +AWS Outposts. https://aws.amazon.com/ outposts/. Last accessed 08 June 2021. +Azure Stack Edge. https://azure.microsoft.com/en-us/products/azure-stack/edge/. Last accessed 08 June 2021. +Ba, J. and Caruana, R. Do Deep Nets Really Need to be Deep? In Advances in Neural Information Processing Systems (NIPS 14), 2014. +Barroso, L. A., Clidaras, J., and Holzle, U. The Datacenter as a Computer: An Introduction to the Design of Warehouse-scale Machines. Synthesis Lectures on Computer Architecture, 8(3):1-154, 2013. +Bengio, Y., Louradour, J., Collobert, R., and Weston, J. Curriculum Learning. In Proceedings of the 26th Annual International Conference on Machine Learning (ICML 09), 2009. +Bhardwaj, R., Xia, Z., Ananthanarayanan, G., Jiang, J., Karianakis, N., Shu, Y., Hsieh, K., Bahl, V., and Stoica, I. Ekya: Continuous Learning of Video Analytics Models on Edge Compute Servers. arXiv preprint arXiv:2012.10557, 2020. +Blalock, D., Ortiz, J. J. G., Frankle, J., and Guttag, J. What is the State of Neural Network Pruning? In The Third Conference on Systems and Machine Learning (MLSys 20), 2020. +Cai, H., Zhu, L., and Han, S. ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware. In Proceedings of the 6th International Conference on Learning Representations (ICLR 18), 2018. +Cai, H., Gan, C., Wang, T., Zhang, Z., and Han, S. Once for All: Train One Network and Specialize it for Efficient Deployment. In International Conference on Learning Representations (ICLR 20), 2020. +Canel, C., Kim, T., Zhou, G., Li, C., Lim, H., Andersen, D. G., Kaminsky, M., and Dulloor, S. R. Scaling Video Analytics on Constrained Edge Nodes. In Proceedings of the 2nd Conference on Systems and Machine Learning (SysML 19), 2019. +Dhakal, A., Kulkarni, S. G., and Ramakrishnan, K. GSLICE: Controlled Spatial Sharing of GPUs for a Scalable Inference Platform. In Proceedings of the 11th ACM Symposium on Cloud Computing (SOCC 20), 2020. +Hsieh, K., Ananthanarayanan, G., Bodik, P., Venkataraman, S., Bahl, P., Philipose, M., Gibbons, P. B., and Mutlu, O. Focus: Querying Large Video Datasets with Low Latency and Low Cost. In Proceedings of the 13th USENIX + +Symposium on Operating Systems Design and Implementation (OSDI 18), 2018. +Jain, P., Mo, X., Jain, A., Subbaraj, H., Durrani, R. S., Tumanov, A., Gonzalez, J., and Stoica, I. Dynamic Space-Time Scheduling for GPU Inference. In NeurIPS Workshop on Systems for Machine Learning, 2018. +Jouppi, N. P., Young, C., Patil, N., Patterson, D., Agrawal, G., Bajwa, R., Bates, S., Bhatia, S., Boden, N., Borchers, A., et al. In-datacenter Performance Analysis of a Tensor Processing Unit. In 2017 ACM/IEEE 44th Annual International Symposium on Computer Architecture (ISCA 17), 2017. +Kang, D., Emmons, J., Abuzaid, F., Bailis, P., and Zaharia, M. NoScope: Optimizing Neural Network Queries over Video at Scale. Proceedings of the VLDB Endowment, 10 (11):1586-1597, 2017. +Kang, D., Bailis, P., and Zaharia, M. BlazeIt: Optimizing Declarative Aggregation and Limit Queries for Neural Network-Based Video Analytics. Proceedings of the VLDB Endowment, 13(4), 2020. +Kosaian, J., Rashmi, K. V., and Venkataraman, S. Learning-Based Coded Computation. IEEE Journal on Selected Areas in Information Theory, 2020. +Ma, N., Zhang, X., Zheng, H.-T., and Sun, J. ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design. In Proceedings of the 15th European Conference on Computer Vision (ECCV 18), 2018. +Mullapudi, R. T., Chen, S., Zhang, K., Ramanan, D., and Fatahalian, K. Online Model Distillation for Efficient Video Inference. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV 19), pp. 3573-3582, 2019. +Narayanan, D., Santhanam, K., Phanishayee, A., and Zaharia, M. Accelerating Deep Learning Workloads Through Efficient Multi-Model Execution. In NeurIPS Workshop on Systems for Machine Learning, 2018. +NVIDIA. NVIDIA Deep Learning Performance Guide. https://docs.nvidia.com/deeplearning/ SDK/dl-performance-guide/index.html. Last accessed 08 June 2021. +NVIDIA. NVIDIA Tesla V100 GPU Architecture. Technical Report WP-08608-001_v1.1, 2017. +NVIDIA. NVIDIA Turing GPU Architecture. Technical Report WP-09183-001_v01, 2018. +NVIDIA. NVIDIA TensorRT. https://developer.nvidia.com/tensorrt, 2021. Last accessed 08 June 2021. + +Shen, H., Han, S., Philipose, M., and Krishnamurthy, A. Fast Video Classification via Adaptive Cascading of Deep Models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR 17), 2017. +Shen, H., Chen, L., Jin, Y., Zhao, L., Kong, B., Philipose, M., Krishnamurthy, A., and Sundaram, R. Nexus: A GPU Cluster Engine for Accelerating DNN-based Video Analysis. In Proceedings of the 27th ACM Symposium on Operating Systems Principles (SOSP 19), 2019. +Tan, M. and Le, Q. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. In Proceedings of the 36th International Conference on Machine Learning (ICML 19), 2019. +Wang, H. Low Precision Inference on GPU. https://tinyurl.com/1g9e5dpw, 2019. Last accessed 08 June 2021. +Williams, S., Waterman, A., and Patterson, D. Roofline: an Insightful Visual Performance Model for Multicore Architectures. Communications of the ACM, 52(4):65-76, 2009. +Wu, B., Dai, X., Zhang, P., Wang, Y., Sun, F., Wu, Y., Tian, Y., Vajda, P., Jia, Y., and Keutzer, K. FBNet: Hardware-Aware Efficient ConvNet Design via Differentiable Neural Architecture Search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR 19), 2019. +Yu, P. and Chowdhury, M. Salus: Fine-Grained GPU Sharing Primitives for Deep Learning Applications. In The Third Conference on Systems and Machine Learning (ML-Sys 20), 2020. +Zhou, Y., Ebrahimi, S., Arik, S. Ö., Yu, H., Liu, H., and Diamos, G. Resource-Efficient Neural Architect. arXiv preprint arXiv:1806.07912, 2018. \ No newline at end of file diff --git a/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/images.zip b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..15db146f3732928bf2d4a04ca43f06d0e601b243 --- /dev/null +++ b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:919aab1d71b655f1a80304250a84db0b922cd0932c4d58976a4df64398c31ddb +size 483107 diff --git a/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/layout.json b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..25d8f03cd548e96e88c7fc58d32b4da4b962be23 --- /dev/null +++ b/boostingthethroughputandacceleratorutilizationofspecializedcnninferencebeyondincreasingbatchsize/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf0c5b54948e7cb519328fbd9087a5229278233873f24095e11d8aaada7b5831 +size 488446 diff --git a/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_content_list.json b/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..774f5e29ebd9c1318898afd731a71a8b433322be --- /dev/null +++ b/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:351f5c7439d9bec6a72a5a6aec330235d64c30c40519efddef3226193e7b5907 +size 84394 diff --git a/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_model.json b/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c659e4bf378a9185e4339cb5f4f3b8176663b16c --- /dev/null +++ b/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ff616ff847c2d4074b14ed63ba20a7618e7dd7c0d9ea96beb2073a1c840fd6f +size 104784 diff --git a/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_origin.pdf b/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..53bcef0b64e1e944200da5f0fe31efa9f4f0978a --- /dev/null +++ b/bootstrappingfittedqevaluationforoffpolicyinference/a642b8d8-6d80-4eee-99e9-6a7bf9aa95bc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcc744071d8e955a6c5fb836015030098ad6614d7bce96ec8c0fd939abaeac97 +size 1321487 diff --git a/bootstrappingfittedqevaluationforoffpolicyinference/full.md b/bootstrappingfittedqevaluationforoffpolicyinference/full.md new file mode 100644 index 0000000000000000000000000000000000000000..45e36ed11487416d95d37d3d8897e15017b78f1a --- /dev/null +++ b/bootstrappingfittedqevaluationforoffpolicyinference/full.md @@ -0,0 +1,398 @@ +# Bootstrapping Fitted Q-Evaluation for Off-Policy Inference + +Botao Hao $^{1}$ Xiang Ji $^{2}$ Yaqi Duan $^{2}$ Hao Lu $^{2}$ Csaba Szepesvári $^{13}$ Mengdi Wang $^{12}$ + +# Abstract + +Bootstrapping provides a flexible and effective approach for assessing the quality of batch reinforcement learning, yet its theoretical properties are poorly understood. In this paper, we study the use of bootstrapping in off-policy evaluation (OPE), and in particular, we focus on the fitted Q-evaluation (FQE) that is known to be minimax-optimal in the tabular and linear-model cases. We propose a bootstrapping FQE method for inferring the distribution of the policy evaluation error and show that this method is asymptotically efficient and distributionally consistent for off-policy statistical inference. To overcome the computation limit of bootstrapping, we further adapt a subsampling procedure that improves the runtime by an order of magnitude. We numerically evaluate the bootstrapping method in classical RL environments for confidence interval estimation, estimating the variance of off-policy evaluator, and estimating the correlation between multiple off-policy evaluators. + +# 1. Introduction + +Off-policy evaluation (OPE) often serves as the starting point of batch reinforcement learning (RL). The objective of OPE is to estimate the value of a target policy based on batch episodes of state-transition trajectories that were generated using a different and possibly unknown behavior policy. In this paper, we investigate statistical inference for OPE. In particular, we analyze the popular fitted Q-evaluation (FQE) method, which is a basic model-free approach that fits unknown value function from data using function approximation and backward dynamic programming (Fonteneau + +$^{1}$ Deepmind $^{2}$ Princeton University $^{3}$ University of Alberta. Correspondence to: Botao Hao , Mengdi Wang . + +Proceedings of the $37^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +et al., 2013; Munos & Szepesvári, 2008; Le et al., 2019). In practice, FQE has demonstrated robust and satisfying performances on many classical RL tasks under different metrics (Voloshin et al., 2019). A more recent study by Paine et al. (2020) demonstrated surprising scalability and effectiveness of FQE with deep neural nets in a range of complex continuous-state RL tasks. On the theoretical side, FQE was proved to be a minimax-optimal policy evaluator in the tabular and linear-model cases (Yin & Wang, 2020; Duan & Wang, 2020). + +The aforementioned research mostly focuses on point estimation for OPE. In practical batch RL applications, a point estimate is far from enough. Statistical inference for OPE is of great interests. For instance, one often hopes to construct tight confidence interval around policy value, estimate the variance of off-policy evaluator, or evaluate multiple policies using the same data and estimate their correlations. Bootstrapping (Efron, 1982), is a conceptually simple and generalizable approach to infer the error distribution based on batch data. Therefore, in this work, we study the use of bootstrapping for off-policy inference. We will provide theoretical justifications as well as numerical experiments. + +Our main results are summarized below: + +- First we analyze the asymptotic distribution of FQE with linear function approximation and show that the policy evaluation error asymptotically follows a normal distribution (Theorem 4.2). The asymptotic variance matches the Cramér-Rao lower bound for OPE (Theorem 4.5) and implies that this estimator is asymptotically efficient. +- We propose a bootstrapping FQE method for estimating the distribution of off-policy evaluation error. We prove that bootstrapping FQE is asymptotically consistent in estimating the distribution of the original FQE (Theorem 5.1) and establish the consistency of bootstrap confidence interval as well as bootstrap variance estimation. Further, we propose a subsampled bootstrap procedure to improve the computational efficiency of bootstrapping FQE. + +- We highlight the necessity of bootstrapping by episodes, rather than by individual sample transition as considered in previous works; see Kostrikov & Nachum (2020). The reason is that bootstrapping dependent data in general fails to characterize the right error distribution (Remark 2.1 in Singh (1981)). We illustrate this phenomenon via experiments (see Figure 1). All our theoretical analysis applies to episodic dependent data, and we do not require the i.i.d. sample transition assumption commonly made in OPE literatures (Jiang & Huang, 2020; Kostrikov & Nachum, 2020; Dai et al., 2020). +- Finally, we evaluate subsampled bootstrapping FQE in a range of classical RL tasks, including a discrete tabular domain, a continuous control domain and a simulated healthcare example. We test variants of bootstrapping FQE with tabular representation, linear function approximation, and neural networks. We carefully examine the effectiveness and tightness of bootstrap confidence intervals, as well as the accuracy of bootstrapping for estimating the variance and correlation for OPE. + +Related Work. Point estimation of OPE receives considerable attention in recent years. Popular approaches include direct methods (Lagoudakis & Parr, 2003; Ernst et al., 2005; Munos & Szepesvári, 2008; Le et al., 2019), double-robust / importance sampling (Precup et al., 2000; Jiang & Li, 2016; Thomas & Brunskill, 2016), marginalized importance sampling (Hallak & Mannor, 2017; Liu et al., 2018; Xie et al., 2019; Nachum et al., 2019; Uehara & Jiang, 2019; Zhang et al., 2020a,b). On the theoretical side, Uehara & Jiang (2019); Yin & Wang (2020) established asymptotic optimality and efficiency for OPE in the tabular setting and Kallus & Uehara (2020) provided a complete study of semiparametric efficiency in a more general setting. Duan & Wang (2020); Hao et al. (2020b) showed that FQE with linear/sparse lienar function approximation is minimax optimal and Wang et al. (2020) studied the fundamental hardness of OPE with linear function approximation. + +Confidence interval estimation of OPE is also important in many high-stake applications. Thomas et al. (2015) proposed a high-confidence OPE based on importance sampling and empirical Bernstein inequality. Kuzborskij et al. (2020) proposed a tighter confidence interval for contextual bandits based on empirical Efron-Stein inequality. However, importance sampling suffers from the curse of horizon (Liu et al., 2018) and concentration-based confidence intervals + +are typically overly-conservative since they only exploit tail information (Hao et al., 2020a). Another line of recent works formulated the estimation of confidence intervals into an optimization problem (Feng et al., 2020; 2021; Dai et al., 2020). These works are specific to confidence interval construction for OPE, and they do not provide distributional consistency guarantee. Thus, they don't easily generalize to other statistical inference tasks. + +In statistics community, Liao et al. (2019) studied OPE in an infinite-horizon undiscounted MDP and derived the asymptotic distribution of empirical Bellman residual minimization estimator. Their asymptotic variance had a tabular representation and thus didn't show the effect of function approximation. Shi et al. (2020) considered asymptotic confidence interval for policy value but under different model assumption that assumes Q-function is smooth. + +Several existing work has investigated the use of bootstrapping in OPE. Thomas et al. (2015); Hanna et al. (2017) constructed confidence intervals by bootstrapping importance sampling estimator or learned models but didn't come with any consistency guarantee. The most related work is Kostrikov & Nachum (2020) that provided the first asymptotic consistency of bootstrap confidence interval for OPE. Our analysis improves their work in the following aspects. First, we study FQE with linear function approximation while Kostrikov & Nachum (2020) only considered the tabular case. Second, we provide distributional consistency of bootstrapping FQE which is stronger than the consistency of confidence interval in Kostrikov & Nachum (2020). + +# 2. Preliminary + +Consider an episodic Markov decision process (MDP) that is defined by a tuple $M = (S, \mathcal{A}, P, r, H)$ . Here, $S$ is the state space, $\mathcal{A}$ is the action space, $P(s'|s, a)$ is the probability of reaching state $s'$ when taking action $a$ in state $s$ , $r: S \times \mathcal{A} \to [0,1]$ is the reward function, and $H$ is the length of horizon. A policy $\pi: S \to \mathcal{P}(\mathcal{A})$ maps states to a distribution over actions. The state-action value function (Q-function) is defined as, for $h = 1, \dots, H$ , + +$$ +Q _ {h} ^ {\pi} (s, a) = \mathbb {E} ^ {\pi} \left[ \sum_ {h ^ {\prime} = h} ^ {H} r \left(s _ {h ^ {\prime}}, a _ {h ^ {\prime}}\right) \Bigg | s _ {h} = s, a _ {h} = a \right], +$$ + +where $a_{h'} \sim \pi(\cdot | s_{h'})$ , $s_{h' + 1} \sim P(\cdot | s_{h'}, a_{h'})$ and $\mathbb{E}^{\pi}$ denotes expectation over the sample path generated under policy $\pi$ . The Q-function satisfies the Bellman equation for policy $\pi$ : + +$$ +Q _ {h - 1} ^ {\pi} (s, a) = r (s, a) + \mathbb {E} \Big [ V _ {h} ^ {\pi} (s ^ {\prime}) | s, a \Big ], +$$ + +where $s' \sim P(\cdot | s, a)$ and $V_h^\pi : S \to \mathbb{R}$ is the value function defined as $V_h^\pi(s) = \int_a Q_h^\pi(s, a) \pi(a|s) \, \mathrm{d}a$ . + +Let $[n] = \{1, \ldots, n\}$ . For a positive semidefinite matrix $X$ , we denote $\lambda_{\min}(X)$ as the minimum eigenvalue of $X$ . Denote $I_d \in \mathbb{R}^{d \times d}$ as a diagonal matrix with 1 as all the diagonal entry and 0 anywhere else. + +Off-policy evaluation. Suppose that the batch data $\mathcal{D} = \{\mathcal{D}_1, \dots, \mathcal{D}_K\}$ consists of $K$ independent episodes collected using an unknown behavior policy $\bar{\pi}$ . Each episode, denoted as $\mathcal{D}_k = \{(s_h^k, a_h^k, r_h^k)\}_{h \in [H]}$ , is a trajectory of $H$ state-transition tuples. It is easy to generalize our analysis to multiple unknown behavior policies since our algorithms do not require the knowledge of the behavior policy. Let $N = KH$ be the total number of sample transitions; and we sometimes write $\mathcal{D} = \{(s_n, a_n, r_n)\}_{n \in [N]}$ for simplicity. The goal of OPE is to estimate the expected cumulative return (i.e., value) of a target policy $\pi$ from a fixed initial distribution $\xi_1$ , based on the dataset $\mathcal{D}$ . The value is defined as + +$$ +v _ {\pi} = \mathbb {E} ^ {\pi} \left[ \sum_ {h = 1} ^ {H} r (s _ {h}, a _ {h}) \Bigg | s _ {1} \sim \xi_ {1} \right]. +$$ + +Fitted Q-evaluation. Fitted Q-evaluation (FQE) is an instance of the fitted Q-iteration method, dated back to Fontenau et al. (2013); Le et al. (2019). Let $\mathcal{F}$ be a given function class, for examples a linear function class or a neural network class. Set $\widehat{Q}_{H + 1}^{\pi} = 0$ . For $h = H,\ldots ,1$ , we recursively estimate $Q_{h}^{\pi}$ by regression and function approximation: + +$$ +\widehat {Q} _ {h} ^ {\pi} = \underset {f \in \mathcal {F}} {\operatorname {a r g m i n}} \left\{\frac {1}{N} \sum_ {n = 1} ^ {N} \left(f \left(s _ {n}, a _ {n}\right) - y _ {n}\right) ^ {2} + \lambda \rho (f) \right\}, +$$ + +where $y_{n} = r_{n} + \int_{a}\widehat{Q}_{h + 1}^{\pi}(s_{n + 1},a)\pi (a|s_{n + 1})\mathrm{d}a$ and $\rho (f)$ is a proper regularizer. The value estimate is + +$$ +\widehat {v} _ {\pi} = \mathbb {E} _ {s \sim \xi_ {1}, a \sim \pi (\cdot | s)} \left[ \widehat {Q} _ {1} ^ {\pi} (x, a) \right], \tag {2.1} +$$ + +which can be directly computed based on $\widehat{Q}_1^\pi$ . See the full description of FQE in Appendix A.1. + +Off-policy inference. Let $\widehat{v}_{\pi}$ be an off-policy estimator of the target policy value $v_{\pi}$ . In addition to the point estimator, we are primarily interested in the distribution of the off-policy evaluation error $\widehat{v}_{\pi} - v_{\pi}$ . We aim to infer the error distribution of $\widehat{v}_{\pi} - v_{\pi}$ in order to conduct statistical inference. Suppose $F$ is an estimated distribution of $\widehat{v}_{\pi} - v_{\pi}$ . Then we can use $F$ for a range of downstream off-policy inference tasks, for examples: + +Moment estimation. With $F$ , we can estimate the $p$ -th moment of $\widehat{v}_{\pi} - v_{\pi}$ by $\int x^p dF(x)$ . Two important examples are bias estimation and variance estimation. +- Confidence interval construction. Define the quantile function of $F$ as $\mathcal{G}(p) = \inf \{x \in \mathbb{R}, p \leq F(x)\}$ . Specify a confidence level $0 < \delta \leq 1$ . With $F$ , we can construct the $1 - \delta$ confidence interval as $[\widehat{v}_{\pi} - \mathcal{G}(1 - \delta / 2), \widehat{v}_{\pi} - \mathcal{G}(\delta / 2)]$ . If $F$ is close to the true distribution of $\widehat{v}_{\pi} - v_{\pi}$ , the above one would be the nearly tightest confidence interval for $v_{\pi}$ based on $\widehat{v}_{\pi}$ . +- Evaluating multiple policies and estimating their correlation. Suppose there are two target policies $\pi_1, \pi_2$ to evaluate and the corresponding off-policy estimators are $\widehat{v}_{\pi_1}, \widehat{v}_{\pi_2}$ . Let $F_{12}$ be the estimated joint distribution of $\widehat{v}_{\pi_1} - v_{\pi_1}$ and $\widehat{v}_{\pi_2} - v_{\pi_2}$ . The Pearson correlation coefficient between the two estimators is + +$$ +\rho (\widehat {v} _ {\pi_ {1}}, \widehat {v} _ {\pi_ {2}}) = \frac {\operatorname {C o v} (\widehat {v} _ {\pi_ {1}} , \widehat {v} _ {\pi_ {2}})}{\sqrt {\operatorname {V a r} (\widehat {v} _ {\pi_ {1}}) \operatorname {V a r} (\widehat {v} _ {\pi_ {2}})}}. +$$ + +Both the covariance and variance can be estimated from $F_{12}$ , so we can further estimate the correlation between off-policy evaluators. + +Remark 2.1 (Practical scenarios of estimating correlations). Correlation is a basic statistical metric for comparing two estimators, and we used it as an example to illustrate that bootstrapping can be used for estimating a variety of statistics not limited to confidence intervals. In medical applications, we may have multiple target treatment policies to compare against, where a correlation estimate together with confidence intervals would make physicians better informed to make a fairer comparison. + +# 3. Bootstrapping Fitted Q-Evaluation (FQE) + +As shown in Le et al. (2019); Voloshin et al. (2019); Duan & Wang (2020); Paine et al. (2020), FQE not only demonstrates strong empirical performances, but also enjoys provably optimal theoretical guarantees. Thus it is natural to conduct bootstrapping on top of FQE for off-policy inference. + +Recall the original dataset $\mathcal{D}$ consists of $K$ episodes. We propose to bootstrap FQE by episodes: Draw sample episodes $\mathcal{D}_1^*,\ldots ,\mathcal{D}_K^*$ independently with replacement from $\mathcal{D}$ . This is the standard Efron's nonparametric bootstrap (Efron, 1982). Then we run FQE on the new bootstrapped set $\mathcal{D}^{*} = \{\mathcal{D}_{1}^{*},\dots,\mathcal{D}_{K}^{*}\}$ as in Eq. (2.1) and let the output $\widehat{v}_{\pi}^{*}$ as the bootstrapping FQE estimator. By repeating the above + +![](images/99a9b31f3e1f777400ac0aea506751a463743b08cb6a972ed83d34673eb6df6d.jpg) + +![](images/49f8a6d619882d8c16648708f9c48816b969661d7b23c95ca1eec4a895ba604e.jpg) + +![](images/06f13132782d66231ad4f74ea96ee3cc47341591862970333ddcedded91564e3.jpg) +Figure 1. Bootstrap by episodes vs. by sample transitions. The first panel is the true FQE error distribution by Monte Carlo approximation. The second panel is the bootstrap distribution by episode while the third one is by sample transitions. Both behavior and target policies are the optimal policy. The number of Monte Carlo and bootstrap samples is 10000. + +process, we may obtain multiple samples of $\widehat{v}_{\pi}^{*}$ , and may use these samples to further conduct off-policy inference (see Section 6.2 for details). + +# 3.1. Bootstrap by episodes vs. bootstrap by sample transitions + +Practitioners may wonder what is the right way to bootstrap a data set. This question is quite well understood in supervised learning when the data points are independent and identically distributed; there the best way to bootstrap is to resample data points directly. However, in episodic RL, although episodes may be generated independently from one another, sample transitions $(s_n, a_n, r_n)$ in the same episode are highly dependent. Therefore, we choose to bootstrap the batch dataset by episodes, rather than by sample transitions which was commonly done according to previous literatures (Kostrikov & Nachum, 2020). We argue that bootstrapping by sample transitions may fail to correctly characterize the target error distribution of OPE. This is due to the in-episode dependence. To illustrate this phenomenon, we conduct numerical experiments using a toy Cliff Walking environment. We compare the true distribution of FQE error obtained by Monte Carlo sampling with error distributions obtained using bootstrapping FQE. Figure 1 clearly shows that the bootstrap distribution of $\widehat{v}_{\pi}^{*} - \widehat{v}_{\pi}$ (by episodes) closely approximates the true error distribution of $\widehat{v}_{\pi} - v_{\pi}$ , while the bootstrap distribution by sample transition is highly irregular and incorrect. This validates our belief that it is necessary to + +bootstrap by episodes and handle dependent data carefully for OPE. + +# 4. Asymptotic Distribution and Optimality of FQE + +Before analyzing the use of bootstrap, we first study the asymptotic properties of FQE estimators. For the sake of theoretical abstraction, we focus our analysis on the FQE with linear function approximation, because it is the most basic and universal function approximation. We will show that the FQE error is asymptotically normal and its asymptotic variance exactly matches the Cramér-Rao lower bound. All the proofs are deferred to Appendix A.3 and A.4. + +Notations. Given a feature map $\phi : \mathbb{R}^{S \times \mathcal{A}} \to \mathbb{R}^d$ , we let $\mathcal{F}$ be a linear function class spanned by $\phi$ . Without loss of generality, we assume $\| \phi(s, a) \|_{\infty} \leq 1$ for any $(s, a) \in S \times \mathcal{A}$ . Define the Bellman operator for policy $\pi$ as $\mathcal{P}^{\pi}: \mathbb{R}^{S \times \mathcal{A}} \to \mathbb{R}^{S \times \mathcal{A}}$ such that for any $f: S \times \mathcal{A} \to \mathbb{R}$ , $\mathcal{P}^{\pi} f(s, a) = \mathbb{E}_{s' \sim P(\cdot | s, a), a' \sim \pi(\cdot | s')}[f(s', a')]$ . Denote the expected covariance matrix induced by the feature $\phi$ as $\Sigma = \mathbb{E}[\frac{1}{H} \sum_{h=1}^{H} \phi(s_h^1, a_h^1) \phi(s_h^1, a_h^1)^\top]$ , where $\mathbb{E}$ is the expectation over population distribution generated by the behavior policy. + +# 4.1. Asymptotic normality + +We need a representation condition about the function class $\mathcal{F}$ , which will ensure sample-efficient policy evaluation via FQE. + +Condition 4.1 (Policy completeness). For any $f \in \mathcal{F}$ , we assume $\mathcal{P}^\pi f \in \mathcal{F}$ , and $r \in \mathcal{F}$ . + +Policy completeness requires the function class $\mathcal{F}$ can well capture the Bellman operator. It is crucial for the estimation consistency of FQE (Le et al., 2019; Duan & Wang, 2020) and implies the realizability condition $Q_h^\pi \in \mathcal{F}$ for $h \in [H]$ . Recently, Wang et al. (2020) established a lower bound showing that the condition $Q_h^\pi \in \mathcal{F}$ alone is not enough for sample-efficient OPE. Thus we need the policy completeness condition in order to leverage the generalizability of linear function class. + +Next we present our first main result. The theorem presents the asymptotic normality of FQE with linear function approximation. For any $h_1 \in [H]$ , $h_2 \in [H]$ , define the cross-time-covariance matrix as + +$$ +\Omega_ {h _ {1}, h _ {2}} = \mathbb {E} \left[ \frac {1}{H} \sum_ {h ^ {\prime} = 1} ^ {H} \phi \left(s _ {h ^ {\prime}} ^ {1}, a _ {h ^ {\prime}} ^ {1}\right) \phi \left(s _ {h ^ {\prime}} ^ {1}, a _ {h ^ {\prime}} ^ {1}\right) ^ {\top} \varepsilon_ {h _ {1}, h ^ {\prime}} ^ {1} \varepsilon_ {h _ {2}, h ^ {\prime}} ^ {1} \right], +$$ + +where $\varepsilon_{h_1,h'}^1 = Q_{h_1}^\pi (s_{h'}^1,a_{h'}^1) - (r_{h'}^1 +V_{h_1 + 1}^\pi (s_{h' + 1}^1))$ + +Theorem 4.2 (Asymptotic normality of FQE). Suppose $\lambda_{\min}(\Sigma) > 0$ and Condition 4.1 holds. The FQE with linear function approximation is $\sqrt{N}$ -consistent and asymptotically normal: + +$$ +\sqrt {N} \left(\widehat {v} _ {\pi} - v _ {\pi}\right) \xrightarrow {d} \mathcal {N} (0, \sigma^ {2}), \text {a s} N \to \infty , \tag {4.1} +$$ + +where $\xrightarrow{d}$ denotes converging in distribution. The asymptotic variance $\sigma^2$ is given by + +$$ +\begin{array}{l} \sigma^ {2} = \sum_ {h = 1} ^ {H} \left(\nu_ {h} ^ {\pi}\right) ^ {\top} \Sigma^ {- 1} \Omega_ {h, h} \Sigma^ {- 1} \nu_ {h} ^ {\pi} \tag {4.2} \\ + 2 \sum_ {h _ {1} < h _ {2}} (\nu_ {h _ {1}} ^ {\pi}) ^ {\top} \Sigma^ {- 1} \Omega_ {h _ {1}, h _ {2}} \Sigma^ {- 1} \nu_ {h} ^ {\pi}, \\ \end{array} +$$ + +where $\nu_h^\pi = \mathbb{E}^\pi [\phi (s_h,a_h)|s_1\sim \xi_1]$ + +The proof is based on a decomposition of the FQE error $\sqrt{N} (\widehat{v}_{\pi} - v_{\pi})$ into the sum of a primary term, which is a sum of the martingale differences, and two small-order terms that are asymptotically negligible. For the primary term, we utilize classical martingale central limit theorem (McLeish et al., 1974) to prove its asymptotic normality. + +Remark 4.3. The second term on the right-hand side of Eq. (4.2) (cross-product term) characterizes the dependency between two different fitted-Q steps. When considering a tabular time-inhomogeneous MDP that was used in Yin & Wang (2020), this cross-product term disappears and the asymptotic variance becomes + +$$ +\sum_ {h = 1} ^ {H} \mathbb {E} \left[ \frac {\mu_ {h} ^ {\pi} \left(s _ {h} ^ {1} , a _ {h} ^ {1}\right) ^ {2}}{\bar {\mu} _ {h} \left(s _ {h} ^ {1} , a _ {h} ^ {1}\right) ^ {2}} \left(\varepsilon_ {h, h} ^ {1}\right) ^ {2} \right], +$$ + +where $\bar{\mu}_h$ is the marginal distribution of $(s_h^1, a_h^1)$ and $\mu_h^\pi$ is the marginal distribution of $(s_h, a_h)$ under policy $\pi$ . This matches the asymptotic variance term in Remark 3.2 of Yin & Wang (2020). + +Next, we give a corollary about the joint asymptotic error distribution when evaluating multiple policies. Denote $\Pi = \{\pi_1,\dots ,\pi_L\}$ as a set of target policies to evaluate and denote $\widehat{v}_{\pi_k}$ as the FQE estimator of the policy $\pi_{k}$ . For each $\pi_{k}\in \Pi$ , let $\varepsilon_{h_1,h'}^{1,k} = Q_{h_1}^{\pi_k}(s_{h'}^1,a_{h'}^1) - (r_{h'}^1 +V_{h_1 + 1}^{\pi_k}(s_{h' + 1}^1))$ . For any $h_1\in [H],h_2\in [H]$ , denote + +$$ +\Omega_ {h _ {1}, h _ {2}} ^ {j, k} = \mathbb {E} \left[ \frac {1}{H} \sum_ {h ^ {\prime} = 1} ^ {H} \phi \left(s _ {h ^ {\prime}} ^ {1}, a _ {h ^ {\prime}} ^ {1}\right) \phi \left(s _ {h ^ {\prime}} ^ {1}, a _ {h ^ {\prime}} ^ {1}\right) ^ {\top} \varepsilon_ {h _ {1}, h ^ {\prime}} ^ {1, j} \varepsilon_ {h _ {2}, h ^ {\prime}} ^ {1, k} \right]. +$$ + +Corollary 4.4 (Multiple policies). Suppose the conditions in Theorem 4.2 hold. The set of FQE estimators converge + +in distribution to a multivariate Gaussian distribution: + +$$ +\left( \begin{array}{c} \sqrt {N} \left(\widehat {v} _ {\pi_ {1}} - v _ {\pi_ {1}}\right) \\ \vdots \\ \sqrt {N} \left(\widehat {v} _ {\pi_ {L}} - v _ {\pi_ {L}}\right) \end{array} \right) \xrightarrow {d} \mathcal {N} (0, \Gamma), +$$ + +where the covariance matrix $\Gamma = (\sigma_{jk}^2)_{j,k=1}^L \in \mathbb{R}^{L \times L}$ with + +$$ +\begin{array}{l} \sigma_ {j k} ^ {2} = \sum_ {h = 1} ^ {H} \left(\nu_ {h} ^ {\pi_ {j}}\right) ^ {\top} \Sigma^ {- 1} \Omega_ {h, h} ^ {j, k} \Sigma^ {- 1} \nu_ {h} ^ {\pi_ {k}} \\ + 2 \sum_ {h _ {1} < h _ {2}} \left(\nu_ {h _ {1}} ^ {\pi_ {j}}\right) ^ {\top} \Sigma^ {- 1} \Omega_ {h _ {1}, h _ {2}} ^ {j, k} \Sigma^ {- 1} \nu_ {h} ^ {\pi_ {k}}. \\ \end{array} +$$ + +# 4.2. Asymptotic efficiency + +An asymptotic efficient estimator has the minimal variance among all the unbiased estimator or its variance matches the Cramér-Rao bound asymptotically. + +Theorem 4.5 (Linear Cramér-Rao lower bound). Under Condition 4.1 with linear function class, the variance of any unbiased OPE estimator is lower bounded by $\sigma^2$ defined in Eq. (4.2). + +The above theorem implies FQE with linear function approximation is asymptotic efficient. Jiang & Li (2016) derived the first Cramér-Rao lower bound for the tabular MDP that depends the size of state and action spaces. Our lower bound is stronger in the sense that it only depends on the feature dimension $d$ . Kallus & Uehara (2020) studied more general semiparametric efficiency bound but can not be directly applied to our case since they do not consider the policy completeness assumption. + +# 5. Distributional Consistency of Bootstrapping FQE + +In this section, we show that the bootstrapping FQE method is distributionally consistent. More precisely, we prove that, the bootstrap distribution of $\sqrt{N} (\widehat{v}_{\pi}^{*} - \widehat{v}_{\pi})$ , conditioned on data $\mathcal{D}$ , asymptotically imitates the true error distribution $\sqrt{N} (\widehat{v}_{\pi} - v_{\pi})$ . Consequently, we may use the method to construct confidence regions with asymptotically correct and tight coverage. All the proofs are deferred to Appendix A.5 and A.6. + +Suppose that the batch dataset $\mathcal{D}$ is generated from a probability space $(\mathcal{X},\mathcal{A},\mathbb{P}_{\mathcal{D}})$ , and the bootstrap weight $W^{*}$ is from an independent probability space $(\mathcal{W},\Omega ,\mathbb{P}_W)$ . Their joint probability measure is $\mathbb{P}_{\mathcal{D}W^{*}} = \mathbb{P}_{\mathcal{D}}\times \mathbb{P}_{W^{*}}$ . Let $\mathbb{P}_{W^{*}|\mathcal{D}}$ denote the conditional distribution once the dataset $\mathcal{D}$ is given. + +Theorem 5.1 (Distributional consistency). Suppose the same assumptions in Theorem 4.2 hold. Conditioned on $\mathcal{D}$ , we have + +$$ +\sqrt {N} \left(\widehat {v} _ {\pi} ^ {*} - \widehat {v} _ {\pi}\right) \xrightarrow {d} \mathcal {N} (0, \sigma^ {2}), \text {a s} N \to \infty , \tag {5.1} +$$ + +where $\sigma^2$ is defined in Eq. (4.2). Consequently, it implies + +$$ +\begin{array}{l} \sup _ {\alpha \in (0, 1)} \left| \mathbb {P} _ {W ^ {*} | \mathcal {D}} \left(\sqrt {N} \left(\widehat {v} _ {\pi} ^ {*} - \widehat {v} _ {\pi}\right) \leq \alpha\right) \right. \\ \left. - \mathbb {P} _ {\mathcal {D}} \Big (\sqrt {N} \big (\widehat {v} _ {\pi} - v _ {\pi} \big) \leq \alpha \Big) \right|\rightarrow 0. \\ \end{array} +$$ + +Note that the convergence in distribution result applies to the sequence of probability measures $\mathbb{P}_{W^{*}|\mathcal{D}}$ where datasize grows to infinity. The proof of Theorem 5.1 uses techniques that are different from classical analysis of supervised learning. This is because FQE is a fixed-point iteration type algorithm and it has no objective function to minimize directly. This poses some difficulties to apply conventional bootstrap analysis. Thus, our proof utilizes the equivalence between FQE and a model-based plug-in estimator described in Appendix A.2, together with the Mallows metric (Bickel & Freedman, 1981; Freedman et al., 1981) and the multivariate delta theorem. + +Theorem 5.1 sets the theoretical foundation for using bootstrapping for off-policy inference. Eq. (4.1) and Eq. (5.1) together show that the bootstrap error distribution converges to the same limit as the target error distribution of FQE, which are both asymptotically efficient and match the Cramér-Rao lower bound. + +By using the distributional consistency of bootstrapping FQE, we may further construct consistent confidence intervals. Denote the lower $\delta$ th quantile of bootstrap error distribution $q_{\delta}^{\pi} = \inf \{t:\mathbb{P}_{W^{*}|\mathcal{D}}(\widehat{v}_{\pi}^{*} - \widehat{v}_{\pi}\leq t)\geq \delta \}$ . Then we construct the $1 - \delta$ confidence interval of the policy value by: $\mathrm{CI}(\delta) = [\widehat{v}_\pi -q_{1 - \delta /2}^\pi ,\widehat{v}_\pi -q_{\delta /2}^\pi ]$ + +We next establish that the coverage probability of the percentile bootstrap confidence interval for $v_{\pi}$ converges to the nominal level as a consequence of Theorem 5.1 and the consistency of bootstrap moment estimation. + +Corollary 5.2 (Consistency of the coverage probability). + +Under the assumptions in Theorem 5.1, we have as $N\to \infty$ $\mathbb{P}_{\mathcal{D}W^{*}}(v_{\pi}\in \mathrm{CI}(\delta))\to 1 - \delta .$ + +Remark 5.3. Kostrikov & Nachum (2020) proved the consistency of bootstrap confidence interval in the tabular case. In contrast, our result is more general. We establish the distributional consistency for OPE with function approximation. + +Corollary 5.4 (Consistency of the moment estimation). Suppose the assumptions in Theorem 5.1 hold and $\lim \sup_{N\to \infty}\mathbb{E}_{W^{*}|\mathcal{D}}[(\sqrt{N} (\widehat{v}_\pi^* -\widehat{v}_\pi))^q ] < \infty$ for some $q > 2$ . Then we have for any $1\leq r < q$ + +$$ +\mathbb {E} _ {W ^ {*} | \mathcal {D}} \left[ \left(\sqrt {N} (\widehat {v} _ {\pi} ^ {*} - \widehat {v} _ {\pi})\right) ^ {r} \right] \to \int t ^ {r} \mathrm {d} \mu (t), +$$ + +where $\mu (\cdot)$ is the distribution of $\mathcal{N}(0,\sigma^2)$ . + +The consistency of bootstrap variance estimate is immediately implied by setting $r = 2$ . + +# 6. Subsampled Bootstrapping FQE + +Computing bootstrap-based quantities can be prohibitively demanding as the data size grows. Inspired by recent developments from statistics community (Kleiner et al., 2014; Sengupta et al., 2016), we adapt a simple subsampled bootstrap procedure for FQE to accelerate the computation. + +# 6.1. Subsampled bootstrap + +Let the original dataset be $\mathcal{D} = \{\mathcal{D}_1,\dots ,\mathcal{D}_K\}$ . For any dataset $\widetilde{\mathcal{D}}$ , we denote by $\widehat{v}_{\pi}(\widetilde{\mathcal{D}})$ the FQE estimator based on dataset $\widetilde{\mathcal{D}}$ and $B$ as the number of bootstrap samples. The subsampled bootstrap includes the following three steps. For each $b\in [B]$ , we first construct a random subset $\mathcal{D}_{K,s}^{(b)}$ of $s$ episodes where each sample episode is drawn independently without replacement from dataset $\mathcal{D}$ . Typically $s = K^{\gamma}$ for some $0 < \gamma \leq 1$ . Then we generate a resample set $\mathcal{D}_{K,s}^{(b)*}$ of $K$ episodes where each sample episode is drawn independently with replacement from $\mathcal{D}_{K,s}^{(b)}$ . Note that when $s = K$ , $\mathcal{D}_{K,s}^{(b)}$ is always equal to $\mathcal{D}$ such that the subsampled bootstrap reduces to vanilla bootstrap. In the end, we compute $\varepsilon^{(b)} = \widehat{v}_{\pi}(\mathcal{D}_{K,s}^{(b)*}) - \widehat{v}_{\pi}(\mathcal{D}_{K,s}^{(b)})$ . Algorithm 1 gives the full description. + +Remark 6.1 (Computational benefit). In Algorithm 1, although each run of FQE is still over a dataset of $K$ episodes, only $s$ of them are distinct. As a result, the runtime of running FQE on a bootstrapped set can be substantially reduced. With linear function approximation, one run of FQE requires solving $H$ least square problems. Thus the total runtime complexity of the subsampled bootstrapping FQE is $O(B(K^{2\gamma}H^{3}d + Hd^{3}))$ , where $0 < \gamma < 1$ controls the subsample size. When $\gamma$ is small, we achieve significant speedup by an order of magnitude improvements. + +# Algorithm 1 Subsampled Bootstrapping FQE + +input Dataset $\mathcal{D} = \{\mathcal{D}_1,\dots ,\mathcal{D}_K\}$ , target policy $\pi$ , subset size $s$ , number of bootstrap samples $B$ + +1: Compute FQE estimator $\widehat{v}_{\pi}(\mathcal{D})$ (Algorithm 2). +2: for $b = 1, \dots, B$ do +3: Build a random subset $\mathcal{D}_{K,s}^{(b)}$ +4: Feed $\mathcal{D}_{K,s}^{(b)}$ to FQE and compute $\widehat{v}_{\pi}(\mathcal{D}_{K,s}^{(b)})$ . +5: Generate a resample set $\mathcal{D}_{K,s}^{(b)*}$ . +6: Compute $\widehat{v}_{\pi}(\mathcal{D}_{K,s}^{(b)*})$ +7: Compute $\varepsilon^{(b)} = \widehat{v}_{\pi}(\mathcal{D}_{K,s}^{(b)*}) - \widehat{v}_{\pi}(\mathcal{D}_{K,s}^{(b)})$ +8: end for + +output $\{\varepsilon^{(1)},\dots ,\varepsilon^{(B)}\}$ + +# 6.2. Off-policy inference via bootstrapping FQE + +We describe how to conduct off-policy inference based on the output of Algorithm 1. + +- Bootstrap variance estimation. To estimate the variance of FQE estimators, we calculate the bootstrap sample variance as + +$$ +\widehat {\operatorname {V a r}} \left(\widehat {v} _ {\pi} (\mathcal {D})\right) = \frac {1}{B - 1} \sum_ {b = 1} ^ {B} \left(\varepsilon^ {(b)} - \bar {\varepsilon}\right) ^ {2}, +$$ + +where $\bar{\varepsilon} = \frac{1}{B}\sum_{b = 1}^{B}\varepsilon^{(b)}$ . + +- Bootstrap confidence interval. Compute the $\delta / 2$ and $1 - \delta / 2$ quantile of the empirical distribution $\{\varepsilon^{(1)}, \ldots, \varepsilon^{(B)}\}$ , denoted as $\widehat{q}_{\delta / 2}^{\pi}, \widehat{q}_{1 - \delta / 2}^{\pi}$ respectively. The percentile bootstrap confidence interval is $[\widehat{v}_{\pi}(\mathcal{D}) - \widehat{q}_{1 - \delta / 2}^{\pi}, \widehat{v}_{\pi}(\mathcal{D}) - \widehat{q}_{\delta / 2}^{\pi}]$ . +- Bootstrap correlation estimation. For any of two target policies $\pi_1$ and $\pi_2$ , we want to estimate the Pearson correlation coefficient between their FQE estimators. The bootstrap sample correlation can be computed as $\widehat{\rho}(\widehat{v}_{\pi_1}(\mathcal{D}), \widehat{v}_{\pi_2}(\mathcal{D})) =$ + +$$ +\frac {\sum_ {b = 1} ^ {B} \left(\varepsilon_ {1} ^ {(b)} - \bar {\varepsilon} _ {1}\right) \left(\varepsilon_ {2} ^ {(b)} - \bar {\varepsilon} _ {2}\right)}{\sqrt {\sum_ {b = 1} ^ {B} \left(\varepsilon_ {1} ^ {(b)} - \bar {\varepsilon} _ {1}\right) ^ {2}} \sqrt {\sum_ {b = 1} ^ {B} \left(\varepsilon_ {2} ^ {(b)} - \bar {\varepsilon} _ {2}\right) ^ {2}}}. +$$ + +# 7. Experiments + +In this section, we numerically evaluate the proposed bootstrapping FQE method in several RL environments. For constructing confidence intervals, we fix the confidence level at $\delta = 0.1$ . For estimating variance and correlations, we average the results over 200 trials. More details about the experiment are given in Appendix C. + +# 7.1. Experiment with tabular discrete environment + +We first consider the Cliff Walking environment (Sutton & Barto, 2018), with artificially added randomness to create stochastic transitions (see Appendix C for details). The target policy is chosen to be a near-optimal policy, trained using Q-learning. Consider three choices of the behavior policy: the same as the target policy (on-policy), $0.1\epsilon$ -greedy policy and soft-max policy with temperature 1.0 based on the learned optimal Q-function. The results for soft-max policy and correlation estimation are deferred to Appendix C. + +We test three different methods. The first two methods are subsampled bootstrapping FQE with subsample sizes $s = K$ (the vanilla bootstrap) and $s = K^{0.5}$ (the computational-efficient version), where $B = 100$ . The third method is the high-confidence off-policy evaluation (HCOPE) (Thomas et al., 2015), which we use as a baseline for comparison. HCOPE is a method for constructing off-policy confident interval for tabular MDP, and it is based on concentration inequalities and has provable coverage guarantee. We also compare these methods with the oracle confidence interval (which is the true distribution's quantile obtained by Monte Carlo simulation). + +Coverage and tightness of off-policy confidence interval (CI). We study the empirical coverage probability and interval width with different number of episodes. Figure 2 shows the result under different behavior policies. In the left panel of Figure 3, we report the effect of the number of bootstrap samples on empirical coverage probability ( $\epsilon$ -greedy behavior policy, $K = 100$ ). It is clear that the empirical coverage of our confidence interval based on bootstrapping FQE becomes increasingly close to the expected coverage ( $= 1 - \delta$ ) as the number of episodes increases. The width of bootstrapping-FQE confidence interval is significantly tighter than that of the HCOPE and very close to the oracle one. It is worth noting that, even in the on-policy case, our bootstrap-based confidence interval still has a clear advantage over the concentration-based confidence interval. The advantage of our method comes from that it fully exploits the distribution information. However, bootstrap confidence interval tends to be under-estimate when the number of episodes is extremely small ( $K = 10$ ). Thus we suggest the practitioner to use bootstrap methods when the sample size is moderately large ( $K > 50$ ). + +Further, the subsampled bootstrapping FQE demonstrates a competitive performance as well as significantly reduced computation time. The saving in computation time becomes + +![](images/ae1c0a0b167678757e71600bfcad6adca1f545f9f819cd465c551a8eee7ac8a9.jpg) + +![](images/45b59eca4cacd15e6698034c57d91bb20568b8f0bca857ce84dcb49b47bfe5b8.jpg) + +![](images/5c079d35d251459243d900c2882929807380b547790df90602980f4999f80724.jpg) +Figure 2. Off-policy CI for Cliff Walking. Left: Empirical coverage probability of CI; Right: CI width under different behavior policies. Boostrapping-FQE confidence interval method demonstrates better and tighter coverage of the groundtruth. It closely resembles the oracle confidence interval which comes from the true error distribution. + +![](images/8cea5d56b2a4226010816d35f47dfbd28aa6efbd514841a364fffcf5d75f07cd.jpg) + +![](images/cca7138455ea5de9416205a81a701a8c696f52db2e13b8bfbaf92975e7a143ab.jpg) +Figure 3. Sample and time efficiency of bootstrapping FQE. Left: Empirical coverage of bootstrapping-FQE CI, as #bootstrap samples increases. Right: Runtime of bootstrapping FQE, as data-size increases (with subsample size $s = K^{0.5}$ ). + +![](images/73502f9b6cfd50a3cf01d09aa398a2f1a88937ea826c4679b99e9507305a5436.jpg) + +![](images/9324a1acc29db2ec0e3a893c798c107cb86535bf6e4092770aafc26993a38220.jpg) +Figure 4. Bootstrapping for variance estimation and with function approximation Left: Error of variance estimates for tabular case, as data size increases. Right: Confidence interval constructed using bootstrapping FQE with linear function approximation. + +![](images/94771ff321096f9a603e6d44ac1bc6ef7d2b79e6c7b466251560ccb435b4b77f.jpg) + +increasingly substantial as the data gets big; see the right panel of Figure 3. + +Bootstrapping FQE for variance estimation. We study the performance of variance estimation using subsampled bootstrapping FQE under three different behavior policies. We vary the number of episodes and the true $\operatorname{Var}(\widehat{v}_{\pi}(\mathcal{D}))$ is computed through Monte Carlo method. We report the + +estimation error of $\widehat{\operatorname{Var}}(\widehat{v}_{\pi}(\mathcal{D})) - \operatorname{Var}(\widehat{v}_{\pi}(\mathcal{D}))$ across 200 trials in the left panel of Figure 4. + +# 7.2. Experiment with Mountain Car using linear function approximation + +Next we test the methods on the classical Mountain Car environment (Moore, 1990) with linear function approximation. We artificially added a Gaussian random force to the car's dynamics to create stochastic transitions. For the linear function approximation, we choose 400 radial basis functions (RBF) as the feature map. The target policy is chosen as the optimal policy trained by Q-learning; and the behavior policy is chosen to be the $0.1\epsilon$ -greedy policy based on the learned optimal Q-function. + +For comparison, we compute an empirical Bernstein-inequality-based confidence interval (Duan & Wang, 2020), which to our best knowledge is the only provable CI based on FQE with function approximation (see Appendix C for its detailed form). We also compute the oracle CI using Monte Carlo simulation. Figure 4 right gives all the results. According to the results, our method demonstrates good coverage of the groundtruth and is much tighter than the concentration-based CI, even both of them use linear function approximation. + +# 7.3. Experiment with septic management using neural nets for function approximation + +Lastly, we consider a real-world healthcare problem for treating sepsis in the intensive care unit (ICU). We use the septic management simulator by Oberst & Sontag (2019) for our study. It simulates a patient's vital signs, e.g. the heart rate, blood pressure, oxygen concentration, and glucose levels, with three treatment actions (antibiotics, vasopressors, and mechanical ventilation) to choose from at each time step. The reward is $+1$ when a patient is discharged and $-1$ if the patient reaches a life critical state. + +We apply the bootstrapping FQE using neural network function approximator with three fully connected layers, where the first layer uses 256 units and a Relu activation function, the second layer uses 32 units and a Selu activation function, and the last layer uses Softsign. The network takes as input the state-action pair (a 11-dim vector) and outputs a Q-value estimate. Let the behavior policy be the 0.15 $\epsilon$ -greedy policy. + +We evaluate two policies based on the same set of data. This is very common in healthcare problem since we may have multiples treatments by the doctor. One target policy is fixed + +![](images/0c2d73c4e076b622d8a1d993b9dc311db70d8543be3b9d082afd6bbcf2979509.jpg) +Figure 5. Bootstrapping FQE with neural nets for estimating the correlation between two FQE estimators. The left panel is using 300 episodes, while the right panel is using 500 episodes. + +![](images/f939af103b318c9fe6405bc6a65344d35f742a325c0dc83bc4e40c6373ca94a6.jpg) + +![](images/992541694a368c7294923890e50d0683c5b1a10acb531607bd2671015dd0d8a2.jpg) +Figure 6. Estimated confidence region for evaluating two policies using bootstrapping FQE with neural networks. Two target policies are optimal policy and $0.15\epsilon$ -greedy policy. Red point are true values of those two target policies. From left to right, the sample sizes are $K = 100,300,500$ . Here we use the geom density() function to illustrate the density of 2-D bootstrap estimators. + +![](images/5e797bb8308f31c5cd93d0006511277b1c83b02eccc07e5cbc73fcd48ce47090.jpg) + +![](images/787520f8f1b542fe0ee5307693f2bb4b88f95177bd62e371fd3e368d1cf2e823.jpg) + +to be the optimal policy while we vary the other one with different $\epsilon$ -greedy noise. We expect the correlation decreases as the difference between two target policies increases. Figure 5 is well aligned with our expectation. In Figure 6, we plot the confidence region of two target policies obtained by bootstrapping FQE using neural networks. According to Figures 5 and 6, the bootstrapping FQE method can effectively construct confidence regions and correlation estimates, even when using neural networks for function approximation. These results suggest that the proposed bootstrapping FQE method reliably achieves off-policy inference, with more general function approximators. + +# 8. Conclusion + +This paper studies bootstrapping FQE for statistical off-policy inference and establishes its asymptotic distributional consistency as a theoretical benchmark. Our experiments suggest that bootstrapping FQE is effective and efficient in a range of tasks, from tabular problems to continuous problems, with linear and neural network approximation. + +# Acknowledgements + +Csaba Szepesvári gratefully acknowledges funding from the Canada CIFAR AI Chairs Program, Amii and NSERC. Mengdi Wang gratefully acknowledges funding from the U.S. National Science Foundation (NSF) grant CMMI1653435, Air Force Office of Scientific Research (AFOSR) grant FA9550-19-1-020, and C3.ai DTI. + +# References + +Bickel, P. J. and Freedman, D. A. Some asymptotic theory for the bootstrap. The annals of statistics, pp. 1196-1217, 1981. +Dai, B., Nachum, O., Chow, Y., Li, L., Szepesvári, C., and Schuurmans, D. Coindex: Off-policy confidence interval estimation. arXiv preprint arXiv:2010.11652, 2020. +Duan, Y. and Wang, M. Minimax-optimal off-policy evaluation with linear function approximation. *Internation Conference on Machine Learning*, 2020. +Eck, D. J. Bootstrapping for multivariate linear regression models. Statistics & Probability Letters, 134:141-149, 2018. +Efron, B. The jackknife, the bootstrap and other resampling plans. SIAM, 1982. +Ernst, D., Geurts, P., and Wehenkel, L. Tree-based batch mode reinforcement learning. Journal of Machine Learning Research, 6(Apr):503-556, 2005. +Feng, Y., Ren, T., Tang, Z., and Liu, Q. Accountable off-policy evaluation with kernel bellman statistics. Proceedings of the International Conference on Machine Learning, 2020. +Feng, Y., Tang, Z., Zhang, N., and Liu, Q. Non-asymptotic confidence intervals of off-policy evaluation: Primal and dual bounds. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=dKg5D1Z1Lm. +Fonteneau, R., Murphy, S. A., Wehenkel, L., and Ernst, D. Batch mode reinforcement learning based on the synthesis of artificial trajectories. Annals of operations research, 208(1):383-416, 2013. +Freedman, D. A. et al. Bootstrapping regression models. The Annals of Statistics, 9(6):1218-1228, 1981. + +Hallak, A. and Mannor, S. Consistent on-line off-policy evaluation. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1372-1383. JMLR.org, 2017. +Hanna, J. P., Stone, P., and Niekum, S. Bootstrapping with models: Confidence intervals for off-policy evaluation. In Thirty-First AAAI Conference on Artificial Intelligence, 2017. +Hao, B., Abbasi-Yadkori, Y., Wen, Z., and Cheng, G. Bootstrapping upper confidence bound. Thirty-fourth Annual Conference on Neural Information Processing Systems, 2020a. +Hao, B., Duan, Y., Lattimore, T., Szepesvári, C., and Wang, M. Sparse feature selection makes batch reinforcement learning more sample efficient. arXiv preprint arXiv:2011.04019, 2020b. +Jiang, N. and Huang, J. Minimax value interval for off-policy evaluation and policy optimization. Advances in Neural Information Processing Systems, 33, 2020. +Jiang, N. and Li, L. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 652-661, 2016. +Kallus, N. and Uehara, M. Double reinforcement learning for efficient off-policy evaluation in markov decision processes. Journal of Machine Learning Research, 21(167): 1-63, 2020. +Kato, K. A note on moment convergence of bootstrap m-estimators. Statistics & Risk Modeling, 28(1):51-61, 2011. +Kleiner, A., Talwalkar, A., Sarkar, P., and Jordan, M. I. A scalable bootstrap for massive data. Journal of the Royal Statistical Society: Series B: Statistical Methodology, pp. 795-816, 2014. +Kostrikov, I. and Nachum, O. Statistical bootstrapping for uncertainty estimation in off-policy evaluation. arXiv preprint arXiv:2007.13609, 2020. +Kuzborskij, I., Vernade, C., György, A., and Szepesvári, C. Confident off-policy evaluation and selection through self-normalized importance weighting. arXiv preprint arXiv:2006.10460, 2020. +Lagoudakis, M. G. and Parr, R. Least-squares policy iteration. Journal of machine learning research, 4(Dec): 1107-1149, 2003. + +Le, H. M., Voloshin, C., and Yue, Y. Batch policy learning under constraints. Proceedings of Machine Learning Research, 97:3703-3712, 2019. +Liao, P., Klasnja, P., and Murphy, S. Off-policy estimation of long-term average outcomes with applications to mobile health. arXiv preprint arXiv:1912.13088, 2019. +Liu, Q., Li, L., Tang, Z., and Zhou, D. Breaking the curse of horizon: Infinite-horizon off-policy estimation. In Advances in Neural Information Processing Systems, pp 5356-5366, 2018. +McLeish, D. L. et al. Dependent central limit theorems and invariance principles. the Annals of Probability, 2(4): 620-628, 1974. +Moore, A. W. Efficient memory-based learning for robot control. 1990. +Munos, R. and Szepesvári, C. Finite-time bounds for fitted value iteration. Journal of Machine Learning Research, 9 (5), 2008. +1. Nachum, O., Chow, Y., Dai, B., and Li, L. DualDICE: Behavior-agnostic estimation of discounted stationary distribution corrections. In Advances in Neural Information Processing Systems, pp. 2315–2325, 2019. +Oberst, M. and Sontag, D. Counterfactual off-policy evaluation with gumbel-max structural causal models. In International Conference on Machine Learning, pp. 4881-4890, 2019. +Paine, T. L., Paduraru, C., Michi, A., Gulcehre, C., Zolna, K., Novikov, A., Wang, Z., and de Freitas, N. Hyperparameter selection for offline reinforcement learning arXiv preprint arXiv:2007.09055, 2020. +Petersen, K. and Pedersen, M. The matrix cookbook. Technical university of denmark. Technical Manual, 2008. +Precup, D., Sutton, R. S., and Singh, S. Eligibility traces for off-policy policy evaluation. In ICML'00 Proceedings of the Seventeenth International Conference on Machine Learning, 2000. +Sengupta, S., Volgushev, S., and Shao, X. A subsampled double bootstrap for massive data. Journal of the American Statistical Association, 111(515):1222-1232, 2016. +Shi, C., Zhang, S., Lu, W., and Song, R. Statistical inference of the value function for reinforcement learning in infinite horizon settings. arXiv preprint arXiv:2001.04515, 2020 + +Singh, K. On the asymptotic accuracy of efron's bootstrap. The Annals of Statistics, pp. 1187-1195, 1981. +Sutton, R. S. and Barto, A. G. Reinforcement learning: An introduction. MIT press, 2018. +Thomas, P. and Brunskill, E. Data-efficient off-policy policy evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 2139-2148, 2016. +Thomas, P., Theochondrous, G., and Ghavamzadeh, M. High confidence policy improvement. In International Conference on Machine Learning, pp. 2380-2388. PMLR, 2015. +Uehara, M. and Jiang, N. Minimax weight and Q-function learning for off-policy evaluation. arXiv preprint arXiv:1910.12809, 2019. +Van der Vaart, A. W. Asymptotic statistics, volume 3. Cambridge university press, 2000. +Voloshin, C., Le, H. M., Jiang, N., and Yue, Y. Empirical study of off-policy policy evaluation for reinforcement learning. arXiv preprint arXiv:1911.06854, 2019. +Wang, R., Foster, D. P., and Kakade, S. M. What are the statistical limits of offline rl with linear function approximation? arXiv preprint arXiv:2010.11895, 2020. +Xie, T., Ma, Y., and Wang, Y.-X. Towards optimal off-policy evaluation for reinforcement learning with marginalized importance sampling. In Advances in Neural Information Processing Systems, pp. 9665-9675, 2019. +Yin, M. and Wang, Y.-X. Asymptotically efficient off-policy evaluation for tabular reinforcement learning. International Conference on Artificial Intelligence and Statistics, 2020. +Zhang, R., Dai, B., Li, L., and Schuurmans, D. GenDICE: Generalized offline estimation of stationary values. arXiv preprint arXiv:2002.09072, 2020a. +Zhang, S., Liu, B., and Whiteson, S. GradientDICE: Rethinking generalized offline estimation of stationary values. arXiv preprint arXiv:2001.11113, 2020b. \ No newline at end of file diff --git a/bootstrappingfittedqevaluationforoffpolicyinference/images.zip b/bootstrappingfittedqevaluationforoffpolicyinference/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..857ecba21fa86102980148da714481973e57e3fa --- /dev/null +++ b/bootstrappingfittedqevaluationforoffpolicyinference/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3cb3e11f39a556108019af9c1b555f642a2ed1fa13bfb0362fa2c031907ed99 +size 287178 diff --git a/bootstrappingfittedqevaluationforoffpolicyinference/layout.json b/bootstrappingfittedqevaluationforoffpolicyinference/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7a5cae7249c5b58cee04d62ba6a1226cec4465dd --- /dev/null +++ b/bootstrappingfittedqevaluationforoffpolicyinference/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4263285a15931d0745646b7fdd3ac677ba63645d21808fc9d3c23e91366a2bf +size 534649 diff --git a/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_content_list.json b/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fd6dce74150c6c6a482897ec61d475ccfa74348c --- /dev/null +++ b/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04143b69efced34e61f892a69ec807e7cfc3a5d3e4a5946ee173b0107c2df84e +size 99597 diff --git a/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_model.json b/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b661a3f2977fd0f2d689ba2f11f4c861beedb557 --- /dev/null +++ b/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d186c6debd5904090cc03937aa683d961c7e4dce61eb88949e57df9c3273a05 +size 123492 diff --git a/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_origin.pdf b/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e95572e1f1b5dfd5942a923b8989c28af421a7cb --- /dev/null +++ b/breakingthedeadlytriadwithatargetnetwork/b0c9fc7e-8d4f-477d-9647-c3c00d0971e0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13d108eeca918fb9bd6c937a9fa277322b621b940e846c2f46943db60f397e6f +size 599140 diff --git a/breakingthedeadlytriadwithatargetnetwork/full.md b/breakingthedeadlytriadwithatargetnetwork/full.md new file mode 100644 index 0000000000000000000000000000000000000000..42ad9a0852cdb26d2083344c33d13130c8f2533a --- /dev/null +++ b/breakingthedeadlytriadwithatargetnetwork/full.md @@ -0,0 +1,523 @@ +# Shangtong Zhang1 Hengshuai Yao2,3 Shimon Whiteson1 + +# Abstract + +The deadly triad refers to the instability of a reinforcement learning algorithm when it employs off-policy learning, function approximation, and bootstrapping simultaneously. In this paper, we investigate the target network as a tool for breaking the deadly triad, providing theoretical support for the conventional wisdom that a target network stabilizes training. We first propose and analyze a novel target network update rule which augments the commonly used Polyak-averaging style update with two projections. We then apply the target network and ridge regularization in several divergent algorithms and show their convergence to regularized TD fixed points. Those algorithms are off-policy with linear function approximation and bootstrapping, spanning both policy evaluation and control, as well as both discounted and average-reward settings. In particular, we provide the first convergent linear $Q$ -learning algorithms under nonrestrictive and changing behavior policies without bi-level optimization. + +# 1. Introduction + +The deadly triad (see, e.g., Chapter 11.3 of Sutton & Barto (2018)) refers to the instability of a value-based reinforcement learning (RL, Sutton & Barto (2018)) algorithm when it employs off-policy learning, function approximation, and bootstrapping simultaneously. Different from on-policy methods, where the policy of interest is executed for data collection, off-policy methods execute a different policy for data collection, which is usually safer (Dulac-Arnold et al., 2019) and more data efficient (Lin, 1992; Sutton et al., 2011). Function approximation methods use parameterized functions, instead of a look-up table, to represent quantities of interest, which usually cope better with large-scale problems (Mnih et al., 2015; Silver et al., 2016). Bootstrap + +ping methods construct update targets for an estimate by using the estimate itself recursively, which usually has lower variance than Monte Carlo methods (Sutton, 1988). However, when an algorithm employs all those three preferred ingredients (off-policy learning, function approximation, and bootstrapping) simultaneously, there is usually no guarantee that the resulting algorithm is well behaved and the value estimates can easily diverge (see, e.g., Baird (1995); Tsitsiklis & Van Roy (1997); Zhang et al. (2021)), yielding the notorious deadly triad. + +An example of the deadly triad is $Q$ -learning (Watkins & Dayan, 1992) with linear function approximation, whose divergence is well documented in Baird (1995). However, Deep- $Q$ -Networks (DQN, Mnih et al. (2015)), a combination of $Q$ -learning and deep neural network function approximation, has enjoyed great empirical success. One major improvement of DQN over linear $Q$ -learning is the use of a target network, a copy of the neural network function approximator (the main network) that is periodically synchronized with the main network. Importantly, the bootstrapping target in DQN is computed via the target network instead of the main network. As the target network changes slowly, it provides a stable bootstrapping target which in turn stabilizes the training of DQN. Instead of the periodical synchronization, Lillicrap et al. (2015) propose a Polyak-averaging style target network update, which has also enjoyed great empirical success (Fujimoto et al., 2018; Haarnoja et al., 2018). + +Inspired by the empirical success of the target network in RL with deep networks, in this paper, we theoretically investigate the target network as a tool for breaking the deadly triad. We consider a two-timescale framework, where the main network is updated faster than the target network. By using a target network to construct the bootstrapping target, the main network update becomes least squares regression. After adding ridge regularization (Tikhonov et al., 2013) to this least squares problem, we show convergence for both the target and main networks. + +Our main contributions are twofold. First, we propose a novel target network update rule augmenting the Polyak-averaging style update with two projections. The balls for the projections are usually large so most times they are just identity mapping. However, those two projections offer sig- + +nificant theoretical advantages making it possible to analyze where the target network converges to (Section 3). Second, we apply the target network in various existing divergent algorithms and show their convergence to regularized TD (Sutton, 1988) fixed points. Those algorithms are off-policy algorithms with linear function approximation and bootstrapping, spanning both policy evaluation and control, as well as both discounted and average-reward settings. In particular, we provide the first convergent linear $Q$ -learning algorithms under nonrestrictive and changing behavior policies without bi-level optimization, for both discounted and average-reward settings. + +# 2. Background + +Let $M$ be a real positive definite matrix and $x$ be a vector, we use $\| x\| _M\dot{=} \sqrt{x^\top Mx}$ to denote the norm induced by $M$ and $\| \cdot \| _M$ to denote the corresponding induced matrix norm. When $M$ is the identity matrix $I$ , we ignore the subscript $I$ for simplicity. We use vectors and functions interchangeably when it does not cause confusion, e.g., given $f:\mathcal{X}\to \mathbb{R}$ we also use $f$ to denote the corresponding vector in $\mathbb{R}^{|\mathcal{X}|}$ . All vectors are column vectors. We use 1 to denote an all one vector, whose dimension can be deduced from the context. 0 is similarly defined. + +We consider an infinite horizon Markov Decision Process (MDP, see, e.g., Puterman (2014)) consisting of a finite state space $S$ , a finite action space $\mathcal{A}$ , a transition kernel $p: S \times S \times \mathcal{A} \to [0,1]$ , and a reward function $r: S \times \mathcal{A} \to \mathbb{R}$ . At time step $t$ , an agent at a state $S_{t}$ executes an action $A_{t} \sim \pi(\cdot | S_{t})$ , where $\pi: \mathcal{A} \times S \to [0,1]$ is the policy followed by the agent. The agent then receives a reward $R_{t+1} \doteq r(S_{t}, A_{t})$ and proceeds to a new state $S_{t+1} \sim p(\cdot | S_{t}, A_{t})$ . + +In the discounted setting, we consider a discount factor $\gamma \in [0,1)$ and define the return at time step $t$ as $G_{t} \doteq \sum_{i=1}^{\infty} \gamma^{i-1} R_{t+i}$ , which allows us to define the action-value function $q_{\pi}(s,a) \doteq \mathbb{E}_{\pi,p}[G_{t}|S_{t} = s, A_{t} = a]$ . The action-value function $q_{\pi}$ is the unique fixed point of the Bellman operator $\mathcal{T}_{\pi}$ , i.e., $q_{\pi} = \mathcal{T}_{\pi} q_{\pi} \doteq r + \gamma P_{\pi} q_{\pi}$ , where $P_{\pi} \in \mathbb{R}^{|S| |\mathcal{A}| \times |S||\mathcal{A}|}$ is the transition matrix, i.e., $P_{\pi}((s,a), (s',a')) \doteq \sum_{a} p(s'|s,a) \pi(a'|s')$ . + +In the average-reward setting, we assume: + +Assumption 2.1. The chain induced by $\pi$ is ergodic. + +This allows us to define the reward rate + +$\bar{r}_{\pi} \doteq \lim_{T \to \infty} \frac{1}{T} \sum_{t=1}^{T} \mathbb{E}[R_t | p, \pi]$ . The differential action-value function $\bar{q}_{\pi}(s, a)$ is defined as + +$$ +\lim _ {T \rightarrow \infty} \sum_ {t = 0} ^ {T} \mathbb {E} _ {\pi , p} [ r (S _ {t}, A _ {t}) - \bar {r} _ {\pi} | S _ {0} = s, A _ {0} = a ]. +$$ + +The differential Bellman equation is + +$$ +\bar {q} = r - \bar {r} \mathbf {1} + P _ {\pi} \bar {q}, \tag {1} +$$ + +where $\bar{q} \in \mathbb{R}^{|S||A|}$ and $\bar{r} \in \mathbb{R}$ are free variables. It is well known that all solutions to (1) form a set $\{(\bar{q},\bar{r}) \mid \bar{r} = \bar{r}_{\pi}, \bar{q} = q_{\pi} + c\mathbf{1}, c \in \mathbb{R}\}$ (Puterman, 2014). + +The policy evaluation problem refers to estimating $q_{\pi}$ or $(\bar{q}_{\pi},\bar{r}_{\pi})$ . The control problem refers to finding a policy $\pi$ maximizing $q_{\pi}(s,a)$ for each $(s,a)$ or maximizing $\bar{r}_{\pi}$ . With linear function approximation, we approximate $q_{\pi}(s,a)$ or $\bar{q}_{\pi}(s,a)$ with $x(s,a)^{\top}w$ , where $x:\mathcal{S}\times \mathcal{A}\to \mathbb{R}^{K}$ is a feature mapping and $w\in \mathbb{R}^K$ is the learnable parameter. We use $X\in \mathbb{R}^{|S||\mathcal{A}|\times K}$ to denote the feature matrix, each row of which is $x(s,a)^{\top}$ , and assume: + +# Assumption 2.2. $X$ has linearly independent columns. + +In the average-reward setting, we use an additional parameter $\bar{r} \in \mathbb{R}$ to approximate $\bar{r}_{\pi}$ . In the off-policy learning setting, the data for policy evaluation or control is collected by executing a policy $\mu$ (behavior policy) in the MDP, which is different from $\pi$ (target policy). In the rest of the paper, we consider the off-policy linear function approximation setting thus always assume $A_{t} \sim \mu(\cdot | S_{t})$ . We use as shorthand $x_{t} \doteq x(S_{t}, A_{t}), \bar{x}_{t} \doteq \sum_{a} \pi(a | S_{t}) x(S_{t}, a)$ . + +Policy Evaluation. In the discounted setting, similar to Temporal Difference Learning (TD, Sutton (1988)), one can use Off-Policy Expected SARSA to estimate $q_{\pi}$ , which updates $w$ as + +$$ +\delta_ {t} \leftarrow R _ {t + 1} + \gamma \bar {x} _ {t + 1} ^ {\top} w _ {t} - x _ {t} ^ {\top} w _ {t}, +$$ + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \delta_ {t} x _ {t}, \tag {2} +$$ + +where $\{\alpha_t\}$ are learning rates. In the average-reward setting, (1) implies that $\bar{r}_{\pi} = d^{\top}(r + P_{\pi}\bar{q}_{\pi} - \bar{q}_{\pi})$ holds for any probability distribution $d$ . In particular, it holds for $d = d_{\mu}$ . Consequently, to estimate $\bar{q}_{\pi}$ and $\bar{r}_{\pi}$ , Wan et al. (2020); Zhang et al. (2021) update $w$ and $\bar{r}$ as + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \left(R _ {t + 1} - \bar {r} _ {t} + \bar {x} _ {t + 1} ^ {\top} w _ {t} - x _ {t} ^ {\top} w _ {t}\right) x _ {t}, +$$ + +$$ +\bar {r} _ {t + 1} \leftarrow \bar {r} _ {t} + \alpha_ {t} \left(R _ {t + 1} + \bar {x} _ {t + 1} ^ {\top} w _ {t} - x _ {t} ^ {\top} w _ {t} - \bar {r} _ {t}\right). \tag {3} +$$ + +Unfortunately, both (2) and (3) can possibly diverge (see, e.g., Tsitsiklis & Van Roy (1997); Zhang et al. (2021)), which exemplifies the deadly triad in discounted and average-reward settings respectively. + +Control. In the discounted setting, $Q$ -learning with linear function approximation yields + +$$ +\delta_ {t} \leftarrow R _ {t + 1} + \gamma \max _ {a ^ {\prime}} x (S _ {t + 1}, a ^ {\prime}) ^ {\top} w _ {t} - x _ {t} ^ {\top} w _ {t}, +$$ + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \delta_ {t} x _ {t}. \tag {4} +$$ + +In the average-reward setting, Differential $Q$ -learning (Wan et al., 2020) with linear function approximation yields + +$$ +\delta_ {t} \leftarrow R _ {t + 1} - \bar {r} _ {t} + \gamma \max _ {a ^ {\prime}} x (S _ {t + 1}, a ^ {\prime}) ^ {\top} w _ {t} - x _ {t} ^ {\top} w _ {t}, +$$ + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \delta_ {t} x _ {t}, \quad \bar {r} _ {t + 1} \leftarrow \bar {r} _ {t} + \alpha_ {t} \delta_ {t}. \tag {5} +$$ + +Unfortunately, both (4) and (5) can possibly diverge as well (see, e.g., Baird (1995); Zhang et al. (2021)), exemplifying the deadly triad again. + +Motivated by the empirical success of the target network in deep RL, one can apply the target network in the linear function approximation setting. For example, using a target network in (4) yields + +$$ +\delta_ {t} \gets R _ {t + 1} + \gamma \max _ {a ^ {\prime}} x (S _ {t + 1}, a ^ {\prime}) ^ {\top} \theta_ {t} - x _ {t} ^ {\top} w _ {t}, +$$ + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \delta_ {t} x _ {t}, \tag {6} +$$ + +$$ +\theta_ {t + 1} \leftarrow \theta_ {t} + \beta_ {t} \left(w _ {t} - \theta_ {t}\right), \tag {7} +$$ + +where $\theta$ denotes the target network, $\{\beta_t\}$ are learning rates, and we consider the Polyak-averaging style target network update. The convergence of (6) and (7), however, remains unknown. Besides target networks, regularization has also been widely used in deep RL, e.g., Mnih et al. (2015) consider a Huber loss instead of a mean-squared loss; Lillicrap et al. (2015) consider $\ell_2$ weight decay in updating $Q$ -values. + +# 3. Analysis of the Target Network + +In Sections 4 & 5, we consider the merits of using a target network in several linear RL algorithms (e.g., (2) (3) (4) (5)). To this end, in this section, we start by proposing and analyzing a novel target network update rule: + +$$ +\theta_ {t + 1} \doteq \Gamma_ {B _ {1}} \left(\theta_ {t} + \beta_ {t} \left(\Gamma_ {B _ {2}} (w _ {t}) - \theta_ {t}\right)\right). \tag {8} +$$ + +In (8), $w$ denotes the main network and $\theta$ denotes the target network. $\Gamma_{B_1}:\mathbb{R}^K\to \mathbb{R}^K$ is a projection to the ball $B_{1}\doteq \left\{x\in \mathbb{R}^{K}\mid \| x\| \leq R_{B_{1}}\right\}$ , i.e., + +$$ +\Gamma_ {B _ {1}} (x) \doteq x \mathbb {I} _ {\| x \| \leq R _ {B _ {1}}} + (R _ {B _ {1}} x / \| x \|) \mathbb {I} _ {\| x \| > R _ {B _ {1}}}, +$$ + +where $\mathbb{I}$ is the indicator function. $\Gamma_{B_2}$ is a projection onto the ball $B_{2}$ with a radius $R_{B_2}$ . We make the following assumption about the learning rates: + +Assumption 3.1. $\{\beta_t\}$ is a deterministic positive nonincreasing sequence satisfying $\sum_{t} \beta_{t} = \infty, \sum_{t} \beta_{t}^{2} < \infty$ . + +While (8) specifies only how $\theta$ is updated, we assume $w$ is updated such that $w$ can track $\theta$ in the sense that + +Assumption 3.2. There exists $w^{*}:\mathbb{R}^{K}\to \mathbb{R}^{K}$ such that $\lim_{t\to \infty}\| w_t - w^* (\theta_t)\| = 0$ almost surely. + +After making some additional assumptions on $w^{*}$ , we arrive at our general convergent results. + +Assumption 3.3. $\sup_{\theta}\| w^{*}(\theta)\| < R_{B_2} < R_{B_1} < \infty$ + +Assumption 3.4. $w^{*}$ is a contraction mapping w.r.t. $\| \cdot \|$ + +Theorem 1. (Convergence of Target Network) Under Assumptions 3.1-3.4, the iterate $\{\theta_t\}$ generated by (8) satisfies + +$\lim_{t\to \infty}w_t = \lim_{t\to \infty}\theta_t = \theta^*$ almost surely, + +where $\theta^{*}$ is the unique fixed point of $w^{*}(\cdot)$ . + +Assumptions 3.2 - 3.4 are assumed only for now. Once the concrete update rules for $w$ are specified in the algorithms in Sections 4 & 5, we will prove that those assumptions indeed hold. Assumption 3.2 is expected to hold because we will later require that the target network to be updated much slower than the main network. Consequently, the update of the main network will become a standard least-square regression, whose solution $w^{*}$ usually exists. Assumption 3.4 is expected to hold because we will later apply ridge regularization to the least-square regression. Consequently, its solution $w^{*}$ will not change too fast w.r.t. the change of the regression target. + +The target network update (8) is the same as that in (7) except for the two projections, where the first projection $\Gamma_{B_1}$ is standard in optimization literature. The second projection $\Gamma_{B_2}$ , however, appears novel and plays a crucial role in our analysis. First, if we have only $\Gamma_{B_1}$ , the iterate $\{\theta_t\}$ would converge to the invariant set of the ODE + +$$ +\frac {\mathrm {d}}{\mathrm {d} t} \theta (t) = w ^ {*} (\theta (t)) - \theta (t) + \zeta (t), \tag {9} +$$ + +where $\zeta(t)$ is a reflection term that moves $\theta(t)$ back to $B_{1}$ when $\theta(t)$ becomes too large (see, e.g., Section 5 of Kushner & Yin (2003)). Due to this reflection term, it is possible that $\theta(t)$ visits the boundary of $B_{1}$ infinitely often. It thus becomes unclear what the invariant set of (9) is even if $w^{*}$ is contractive. By introducing the second projection $\Gamma_{B_{2}}$ and ensuring $R_{B_{1}} > R_{B_{2}}$ , we are able to remove the reflection term and show that the iterate $\{\theta_t\}$ tracks the ODE + +$$ +\frac {\mathrm {d}}{\mathrm {d} t} \theta (t) = w ^ {*} (\theta (t)) - \theta (t), \tag {10} +$$ + +whose invariant set is a singleton $\{\theta^{*}\}$ when Assumption 3.4 holds. See the proof of Theorem 1 in Section A.1 based on the ODE approach (Kushner & Yin, 2003; Borkar, 2009) for more details. Second, to ensure the main network tracks the target network in the sense of Assumption 3.2 in our applications in Sections 4 & 5, it is crucial that the target network changes sufficiently slowly in the following sense: + +Lemma 1. $\| \theta_{t + 1} - \theta_t\| \leq \beta_tC_0$ for some constant $C_0 > 0$ . + +Lemma 1 would not be feasible without the second projection $\Gamma_{B_2}$ and we defer its proof to Section A.2 + +In Sections 4 & 5, we provide several applications of Theorem 1 in both discounted and average-reward settings, for both policy evaluation and control. We consider a two-timescale framework, where the target network is updated more slowly than the main network. Let $\{\alpha_t\}$ be the learning rates for updating the main network $w$ ; we assume + +Assumption 3.5. $\{\alpha_t\}$ is a deterministic positive nonincreasing sequence satisfying $\sum_{t} \alpha_{t} = \infty, \sum_{t} \alpha_{t}^{2} < \infty$ . Further, for some $d > 0$ , $\sum_{t} (\beta_{t} / \alpha_{t})^{d} < \infty$ . + +# 4. Application to Off-Policy Policy Evaluation + +In this paper, we consider estimating the action-value $q_{\pi}$ instead of the state-value $v_{\pi}$ for unifying notations of policy evaluation and control. The algorithms for estimating $v_{\pi}$ are straightforward up to change of notations and introduction of importance sampling ratios. + +Discounted Setting. Using a target network for bootstrapping in (2) yields + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \left(R _ {t + 1} + \gamma \bar {x} _ {t + 1} ^ {\top} \theta_ {t} - x _ {t} ^ {\top} w _ {t}\right) x _ {t}. +$$ + +As $\theta_{t}$ is quasi-static for $w_{t}$ (Lemma 1 and Assumption 3.5), this update becomes least squares regression. Motivated by the success of ridge regularization in least squares and the widespread use of weight decay in deep RL, which is essentially ridge regularization, we add ridge regularization to this least squares, yielding $Q$ -evaluation with a Target Network (Algorithm 1). + +Algorithm 1 $Q$ -evaluation with a Target Network +INPUT: $\eta >0,R_{B_1} > R_{B_2} > 0$ +Initialize $\theta_0\in B_1$ and $S_{0}$ +Sample $A_0\sim \mu (\cdot |S_0)$ +for $t = 0,1,\ldots$ do Execute $A_{t}$ , get $R_{t + 1}$ and $S_{t + 1}$ Sample $A_{t + 1}\sim \mu (\cdot |S_{t + 1})$ $\bar{x}_{t + 1}\doteq \sum_{a^{\prime}}\pi (a^{\prime}|S_{t + 1})x(S_{t + 1},a^{\prime})$ $\delta_t\dot{=} R_{t + 1} + \gamma \bar{x}_{t + 1}^\top \theta_t - x_t^\top w_t$ $w_{t + 1}\doteq w_t + \alpha_t\delta_tx_t - \alpha_t\eta w_t$ $\theta_{t + 1}\doteq \Gamma_{B_1}\bigl (\theta_t + \beta_t(\Gamma_{B_2}(w_t) - \theta_t)\bigr)$ + +# end for + +Let $A = X^{\top}D_{\mu}(I - \gamma P_{\pi})X, b = X^{\top}D_{\mu}r$ , where $D_{\mu}$ is a diagonal matrix whose diagonal entry is $d_{\mu}$ , the stationary state-action distribution of the chain induced by $\mu$ . Let $\Pi_{D_{\mu}} \doteq X(X^{\top}D_{\mu}X)^{-1}X^{\top}D_{\mu}$ be the projection to the column space of $X$ . We have + +Assumption 4.1. The chain in $\mathcal{S} \times \mathcal{A}$ induced by $\mu$ is ergodic. + +Theorem 2. Under Assumptions 2.2, 3.1, 3.5, & 4.1, for any $\xi \in (0,1)$ , let $C_0 \doteq \frac{2(1 - \xi)\sqrt{\eta}}{\gamma\|P_\pi\|_{D_\mu}}$ , $C_1 \doteq \frac{\|r\|}{2\xi\sqrt{\eta}} + 1$ , then for all $\|X\| < C_0$ , $C_1 < R_{B_1}$ , $R_{B_1} - \xi < R_{B_2} < R_{B_1}$ the iterate $\{w_t\}$ generated by Algorithm 1 satisfies + +$$ +\lim _ {t \rightarrow \infty} w _ {t} = w _ {\eta} ^ {*} \quad a l m o s t s u r e l y, +$$ + +where $w_{\eta}^{*}$ is the unique solution of $(A + \eta I)w - b = 0$ and + +$$ +\begin{array}{l} \left\| X w _ {\eta} ^ {*} - q _ {\pi} \right\| \\ \leq \left(\frac {\sigma_ {\operatorname* {m a x}} (X) ^ {2}}{\sigma_ {\operatorname* {m i n}} (X) ^ {4} \sigma_ {\operatorname* {m i n}} (D _ {\mu}) ^ {2 . 5}} \| q _ {\pi} \| \eta + \left\| \Pi_ {D _ {\mu}} q _ {\pi} - q _ {\pi} \right\|\right) / \xi , \\ \end{array} +$$ + +where $\sigma_{\mathrm{max}}(\cdot),\sigma_{\mathrm{min}}(\cdot)$ denotes the largest and minimum singular values. + +We defer the proof to Section A.3. Theorem 2 requires that the balls for projection are sufficiently large, which is completely feasible in practice. Theorem 2 also requires that the feature norm $\| X\|$ is not too large. Similar assumptions on feature norms also appear in Zou et al. (2019); Du et al. (2019); Chen et al. (2019b); Carvalho et al. (2020); Wang & Zou (2020); Wu et al. (2020) and can be easily achieved by scaling. + +The solutions to $Aw - b = 0$ , if they exist, are TD fixed points for off-policy policy evaluation in the discounted setting (Sutton et al., 2009b;a). Theorem 2 shows that Algorithm 1 finds a regularized TD fixed point $w_{\eta}^{*}$ , which is also the solution of Least-Squares TD methods (LSTD, Boyan (1999); Yu (2010)). LSTD maintains estimates for $A$ and $b$ (referred to as $\hat{A}$ and $\hat{b}$ ) in an online fashion, which requires $\mathcal{O}(K^2)$ computational and memory complexity per step. As $\hat{A}$ is not guaranteed to be invertible, LSTD usually uses $(\hat{A} + \eta I)^{-1}\hat{b}$ as the solution and $\eta$ plays a key role in its performance (see, e.g, Chapter 9.8 of Sutton & Barto (2018)). By contrast, Algorithm 1 finds the LSTD solution (i.e., $w_{\eta}^{*}$ ) with only $\mathcal{O}(K)$ computational and memory complexity per step. Moreover, Theorem 2 provides a performance bound for $w_{\eta}^{*}$ . Let $w_0^* \doteq A^{-1}b$ ; Kolter (2011) shows with a counterexample that the approximation error of TD fixed points (i.e., $\| Xw_0^* - q_\pi \|$ ) can be arbitrarily large if $\mu$ is far from $\pi$ , as long as there is representation error (i.e., $\| \Pi_{D_\mu}q_\pi - q_\pi \| > 0$ ) (see Section 6 for details). By contrast, Theorem 2 guarantees that $\| Xw_{\eta}^{*} - q_{\pi}\|$ is bounded from above, which is one possible advantage of regularized TD fixed points. + +Algorithm 2 Diff. $Q$ -evaluation with a Target Network +INPUT: $\eta >0,R_{B_1} > R_{B_2} > 0$ +Initialize $[\theta_0^r,\theta_0^{w\top}]^\top \in B_1$ and $S_{0}$ +Sample $A_0\sim \mu (\cdot |S_0)$ +for $t = 0,1,\ldots$ do Execute $A_{t}$ get $R_{t + 1}$ and $S_{t + 1}$ Sample $A_{t + 1}\sim \mu (\cdot |S_{t + 1})$ $\bar{x}_{t + 1}\doteq \sum_{a'}\pi (a'|S_{t + 1})x(S_{t + 1},a')$ $\delta_t\dot{=} R_{t + 1} - \theta_t^r +\bar{x}_{t + 1}^\top \theta_t^w -x_t^\top w_t$ $w_{t + 1}\doteq w_t + \alpha_t\delta_tx_t - \alpha_t\eta w_t$ $\bar{r}_{t + 1}\doteq \bar{r}_t + \alpha_t(R_{t + 1} + \bar{x}_{t + 1}^\top \theta_t^w -x_t^\top \theta_t^w -\bar{r}_t)$ $\left[\begin{array}{c}\theta_{t+1}^{r}\\ \theta_{t+1}^{w}\end{array}\right]\doteq\Gamma_{B_1}\big(\left[\begin{array}{c}\theta_t^r\\ \theta_t^w\end{array}\right]+\beta_t(\Gamma_{B_2}\big(\left[\begin{array}{c}\bar{r}_t\\ wt_t\end{array}\right]-\left[\begin{array}{c}\theta_t^r\\ \theta_t^w\end{array}\right]\big)\big)$ +end for + +Average-reward Setting. In the average-reward setting, we need to learn both $\bar{r}$ and $w$ . Hence, we consider target networks $\theta^r$ and $\theta^w$ for $\bar{r}$ and $w$ respectively. Plugging $\theta^r$ and $\theta^w$ into (3) for bootstrapping yields Differential $Q$ -evaluation with a Target Network (Algorithm 2), where $\{B_i\}$ are now balls in $R^{K+1}$ . In Algorithm 2, we impose ridge regularization only on $w$ as $\bar{r}$ is a scalar and thus does + +not have any representation capacity limit. + +Theorem 3. Under Assumptions 2.1, 2.2, 3.1, 3.5, & 4.1, for any $\xi \in (0,1)$ , there exist constants $C_0$ and $C_1$ such that for all $\| X\| < C_0, C_1 < R_{B_1}, R_{B_1} - \xi < R_{B_2} < R_{B_1}$ , the iterates $\{\bar{r}_t\}$ and $\{w_t\}$ generated by Algorithm 2 satisfy + +$$ +\lim _ {t \to \infty} \bar {r} _ {t} = d _ {\mu} ^ {\top} (r + P _ {\pi} X w _ {\eta} ^ {*} - X w _ {\eta} ^ {*}), +$$ + +$\lim_{t\to \infty}w_t = w_\eta^*$ almost surely, + +where $w_{\eta}^{*}$ is the unique solution of $(\bar{A} + \eta I)w - \bar{b} = \mathbf{0}$ with + +$$ +\bar {A} \doteq X (D _ {\mu} - d _ {\mu} d _ {\mu} ^ {\top}) (I - P _ {\pi}) X, +$$ + +$$ +\bar {b} \doteq X ^ {\top} \left(D _ {\mu} - d _ {\mu} d _ {\mu} ^ {\top}\right) r. +$$ + +If features are zero-centered (i.e., $X^{\top}d_{\mu} = \mathbf{0}$ ), then + +$$ +\begin{array}{l} \left| \left| X w _ {\eta} ^ {*} - \bar {q} _ {\pi} ^ {c} \right| \right| \leq \left(\frac {\sigma_ {\operatorname* {m a x}} (X) ^ {2}}{\sigma_ {\operatorname* {m i n}} (X) ^ {4} \sigma_ {\operatorname* {m i n}} (D _ {\mu}) ^ {2 . 5}} \right. \| \bar {q} _ {\pi} ^ {c} \| \eta \\ + \left\| \Pi_ {D _ {\mu}} \bar {q} _ {\pi} ^ {c} - \bar {q} _ {\pi} ^ {c} \right\|) / \xi , \\ \left| \bar {r} _ {\eta} ^ {*} - \bar {r} _ {\pi} \right| \leq \left\| d _ {\mu} ^ {\top} \left(P _ {\pi} - I\right) \right\| \inf _ {c} \left\| \left(X w _ {\eta} ^ {*} - \bar {q} _ {\pi} ^ {c}\right) \right\|, \\ \end{array} +$$ + +where $\bar{q}_{\pi}^{c}\doteq \bar{q}_{\pi} + c\mathbf{I}$ + +We defer the proof to Section A.4. As the differential Bellman equation (1) has infinitely many solutions for $\bar{q}$ , all of which differ only by some constant offsets, we focus on analyzing the quality of $Xw_{\eta}^{*}$ w.r.t. $\bar{q}_{\pi}^{c}$ in Theorem 3. The zero-centered feature assumption is also used in Zhang et al. (2021), which can be easily fulfilled in practice by subtracting all features with the estimated mean. In the on-policy case (i.e., $\mu = \pi$ ), we have $d_{\mu}^{\top}(P_{\pi} - I) = \mathbf{0}$ , indicating $\bar{r}_{\eta}^{*} = \bar{r}_{\pi}$ , i.e., the regularization on the value estimate does not pose any bias on the reward rate estimate. + +As shown by Zhang et al. (2021), if the update (3) converges, it converges to $w_0^*$ , the TD fixed point for off-policy policy evaluation in the average-reward setting, which satisfies $\bar{A} w_0^* + \bar{b} = 0$ . Theorem 3 shows that Algorithm 2 converges to a regularized TD fixed point. Though Zhang et al. (2021) give a bound on $\| Xw_0^* - \bar{q}_\pi^c \|$ , their bound holds only if $\mu$ is sufficiently close to $\pi$ . By contrast, our bound on $w_\eta^*$ in Theorem 3 holds for all $\mu$ . + +# 5. Application to Off-Policy Control + +Discounted Setting. Introducing a target network and ridge regularization in (4) yields $Q$ -learning with a Target Network (Algorithm 3), where the behavior policy $\mu_{\theta}$ depends on $\theta$ through the action-value estimate $X\theta$ and can be any policy satisfying the following two assumptions. + +Assumption 5.1. Let $\mathcal{P}$ be the closure of $\{P_{\mu_\theta} \mid \theta \in \mathbb{R}^K\}$ . For any $P \in \mathcal{P}$ , the Markov chain evolving in $\mathcal{S} \times \mathcal{A}$ induced by $P$ is ergodic. + +Assumption 5.2. $\mu_{\theta}(a|s)$ is Lipschitz continuous in $\theta$ + +Assumption 5.1 is standard. When the behavior policy $\mu$ is fixed (independent of $\theta$ ), the induced chain is usually assumed to be ergodic when analyzing the behavior of $Q$ -learning (see, e.g., Melo et al. (2008); Chen et al. (2019b); Cai et al. (2019)). In Algorithm 3, the behavior policy $\mu_{\theta}$ changes every step, so it is natural to assume that any of those behavior policies induces an ergodic chain. A similar assumption is also used by Zou et al. (2019) in their analysis of on-policy linear SARSA. Moreover, Zou et al. (2019) assume not only the ergodicity but also the uniform ergodicity of their sampling policies. Similarly, in Assumption 5.1, we assume ergodicity for not only all the transition matrices, but also their limits (c.f. the closure $\mathcal{P}$ ). A similar assumption is also used by Marbach & Tsitsiklis (2001) in their analysis of on-policy actor-critic methods. Assumption 5.2 can be easily fulfilled, e.g., by using a softmax policy w.r.t. $x(s,\cdot)^{\top}\theta$ . + +Algorithm 3 $Q$ -learning with a Target Network +INPUT: $\eta >0,R_{B_1} > R_{B_2} > 0$ +Initialize $\theta_0\in B_1$ and $S_{0}$ +Sample $A_0\sim \mu_{\theta_0}(\cdot |S_0)$ +for $t = 0,1,\ldots$ do Execute $A_{t}$ get $R_{t + 1}$ and $S_{t + 1}$ Sample $A_{t + 1}\sim \mu_{\theta_t}(\cdot |S_t)$ $\delta_t\dot{=} R_{t + 1} + \gamma \max_{a'}x(S_{t + 1},a')^\top \theta_t - x_t^\top w_t$ $w_{t + 1}\doteq w_t + \alpha_t\delta_tx_t - \alpha_t\eta w_t$ $\theta_{t + 1}\doteq \Gamma_{B_1}\bigl (\theta_t + \beta_t(\Gamma_{B_2}(w_t) - \theta_t)\bigr)$ +end for + +Theorem 4. Under Assumptions 2.2, 3.1, 3.5, 5.1, & 5.2, for any $\xi \in (0,1), R_{B_1} > R_{B_2} > R_{B_1} - \xi > 0$ , there exists a constant $C_0$ such that for all $\|X\| < C_0$ , the iterate $\{w_t\}$ generated by Algorithm 3 satisfies + +$$ +\lim _ {t \to \infty} w _ {t} = w _ {\eta} ^ {*} \quad a l m o s t s u r e l y, +$$ + +where $w_{\eta}^{*}$ is the unique solution of + +$$ +\left(A _ {\pi_ {w}, \mu_ {w}} + \eta I\right) w - b _ {\mu_ {w}} = \boldsymbol {0} \tag {11} +$$ + +inside $B_{1}$ . Here + +$$ +A _ {\pi_ {w}, \mu_ {w}} \doteq X ^ {\top} D _ {\mu_ {w}} (I - \gamma P _ {\pi_ {w}}) X, b _ {\mu_ {w}} \doteq X ^ {\top} D _ {\mu_ {w}} r, +$$ + +and $\pi_w$ denotes the greedy policy w.r.t. $x(s,\cdot)^\top w$ . + +We defer the proof to Section A.5. Analogously to the policy evaluation setting, if we call the solutions of $A_{\pi_w,\mu_w}w - b_{\mu_w} = \mathbf{0}$ TD fixed points for control in the discounted setting, then Theorem 4 asserts that Algorithm 3 finds a regularized TD fixed point. + +Algorithm 3 and Theorem 4 are significant in two aspects. First, in Algorithm 3, the behavior policy is a function of + +the target network and thus changes every time step. By contrast, previous work on $Q$ -learning with function approximation (e.g., Melo et al. (2008); Maei et al. (2010); Chen et al. (2019b); Cai et al. (2019); Chen et al. (2019a); Lee & He (2019); Xu & Gu (2020); Carvalho et al. (2020); Wang & Zou (2020)) usually assumes the behavior policy is fixed. Though Fan et al. (2020) also adopt a changing behavior policy, they consider bi-level optimization. At each time step, the nested optimization problem must be solved exactly, which is computationally expensive and sometimes unfeasible. To the best of our knowledge, we are the first to analyze $Q$ -learning with function approximation under a changing behavior policy and without nested optimization problems. Compared with the fixed behavior policy setting or the bi-level optimization setting, our two-timescale setting with a changing behavior policy is more closely related to actual practice (e.g., Mnih et al. (2015); Lillicrap et al. (2015)). + +Second, Theorem 4 does not enforce any similarity between $\mu_{\theta}$ and $\pi_w$ ; they can be arbitrarily different. By contrast, previous work (e.g., Melo et al. (2008); Chen et al. (2019b); Cai et al. (2019); Xu & Gu (2020); Lee & He (2019)) usually requires the strong assumption that the fixed behavior policy $\mu$ is sufficiently close to the target policy $\pi_w$ . As the target policy (i.e., the greedy policy) can change every time step due to the changing action-value estimates, this strong assumption rarely holds. While some work removes this strong assumption, it introduces other problems instead. In Greedy-GQ, Maei et al. (2010) avoid this strong assumption by computing sub-gradients of an MSPBE objective $\mathrm{MSPBE}(w) \doteq \| A_{\pi_w, \mu} w - b_\mu \|_{C_\mu^{-1}}^2$ directly, where $C_\mu \doteq X^\top D_\mu X$ . If linear $Q$ -learning (4) under a fixed behavior policy $\mu$ converges, it converges to the minimizer of $\mathrm{MSPBE}(w)$ . Greedy-GQ, however, converges only to a stationary point of $\mathrm{MSPBE}(w)$ . By contrast, Algorithm 3 converges to a minimizer of our regularized MSPBE (c.f. (11)). In Coupled $Q$ -learning, Carvalho et al. (2020) avoid this strong assumption by using a target network as well, which they update as + +$$ +\theta_ {t + 1} \leftarrow \theta_ {t} + \alpha_ {t} \left(\left(x _ {t} x _ {t} ^ {\top}\right) w _ {t} - \theta_ {t}\right). \tag {12} +$$ + +This target network update deviates much from the commonly used Polyak-averaging style update, while our (8) is identical to the Polyak-averaging style update most times if the balls for projection are sufficiently large. Coupled $Q$ -learning updates the main network $w$ as usual (see (6)). With the Coupled $Q$ -learning updates (6) and (12), Carvalho et al. (2020) prove that the main network and the target network converge to $\bar{w}$ and $\bar{\theta}$ respectively, which satisfy + +$$ +X \bar {w} = X X ^ {\top} D _ {\mu} \mathcal {T} _ {\pi_ {\bar {w}}} X \bar {w}, \quad X \bar {\theta} = \Pi_ {D _ {\mu}} \mathcal {T} _ {\pi_ {\bar {w}}} X \bar {w}. +$$ + +It is, however, not clear how $\bar{w}$ and $\bar{\theta}$ relate to TD fixed points. Yang et al. (2019) also use a target network to avoid + +this strong assumption. Their target network update is the same as (8) except that they have only one projection $\Gamma_{B_1}$ . Consequently, they face the problem of the reflection term $\zeta(t)$ (c.f. (9)). They also assume the main network $\{w_t\}$ is always bounded, a strong assumption that we do not require. Moreover, they consider a fixed sampling distribution for obtaining i.i.d. samples, while our data collection is done by executing the changing behavior policy $\mu_\theta$ in the MDP. + +One limit of Theorem 4 is that the bound on $\| X\|$ (i.e., $C_0$ ) depends on $1 / R_{B_1}$ (see the proof in Section A.5 for the analytical expression), which means $C_0$ could potentially be small. Though we can use a small $\eta$ accordingly to ensure that the regularization effect of $\eta$ is modest, a small $C_0$ may not be desirable in some cases. To address this issue, we propose Gradient $Q$ -learning with a Target Network, inspired by Greedy-GQ. We first equip $\mathrm{MSPBE}(w)$ with a changing behavior policy $\mu_w$ , yielding the following objective $\| A_{\pi_w,\mu_w}w - b_{\mu_w}\|_{C_{\mu_w}^{-1}}^2$ . We then use the target network $\theta$ in place of $w$ in the non-convex components, yielding + +$$ +L (w, \theta) \doteq \| A _ {\pi_ {\theta}, \mu_ {\theta}} w - b _ {\mu_ {\theta}} \| _ {C _ {\mu_ {\theta}} ^ {- 1}} ^ {2} + \eta \| w \| ^ {2}, \tag {13} +$$ + +where we have also introduced a ridge term. At time step $t$ , we update $w_{t}$ following the gradient $\nabla_w L(w, \theta_t)$ and update the target network $\theta_t$ as usual. Details are provided in Algorithm 4, where the additional weight vector $u \in \mathbb{R}^K$ results from a weight duplication trick (see Sutton et al. (2009b;a) for details) to address a double sampling issue in estimating $\nabla_w L(w, \theta)$ . + +# Algorithm 4 Gradient $Q$ -learning with a Target Network + +INPUT: $\eta > 0, R_{B_1} > R_{B_2} > 0$ + +Initialize $\theta_0\in B_1$ and $S_{0}$ + +Sample $A_0\sim \mu_{\theta_0}(\cdot |S_0)$ + +for $t = 0,1,\ldots$ do + +Execute $A_{t}$ , get $R_{t + 1}$ and $S_{t + 1}$ + +Sample $A_{t + 1}\sim \mu_{\theta_t}(\cdot |S_t)$ + +$\bar{x}_{t + 1}\doteq \sum_{a^{\prime}}\pi_{\theta_t}(a^{\prime}|S_{t + 1})x(S_{t + 1},a^{\prime})$ + +$\delta_t \doteq R_{t+1} + \gamma \bar{x}_{t+1}^\top w_t - x_t^\top w_t$ + +$u_{t + 1}\dot{=} u_t + \alpha_t(\delta_t - x_t^\top u_t)x_t$ + +$w_{t + 1}\doteq w_t + \alpha_t(x_t - \gamma \bar{x}_{t + 1})x_t^\top u_t - \alpha_t\eta w_t$ + +$\theta_{t + 1}\doteq \Gamma_{B_1}\big(\theta_t + \beta_t(\Gamma_{B_2}(w_t) - \theta_t)\big)$ + +# end for + +In Algorithm 3, the target policy $\pi_w$ is a greedy policy, which is not continuous in $w$ . This discontinuity is not a problem there but requires sub-gradients in the analysis of Algorithm 4, which complicates the presentation. We, therefore, impose Assumption 5.2 on $\pi_w$ as well. + +Assumption 5.3. $\pi_{\theta}(a|s)$ is Lipschitz continuous in $\theta$ + +Though a greedy policy no longer satisfies Assumption 5.3, we can simply use a softmax policy. + +Theorem 5. Under Assumptions 2.2, 3.1, 3.5, & 5.1-5.3, there exist positive constants $C_0$ and $C_1$ such that for all $\| X\| < C_0$ , $R_{B_1} > R_{B_2} > C_1$ , the iterate $\{w_t\}$ generated by Algorithm 4 satisfies + +$$ +\lim _ {t \to \infty} w _ {t} = w _ {\eta} ^ {*} \quad a l m o s t s u r e l y, +$$ + +where $w_{\eta}^{*}$ is the unique solution of + +$$ +(A _ {\pi_ {w}, \mu_ {w}} ^ {\top} C _ {\mu_ {w}} ^ {- 1} A _ {\pi_ {w}, \mu_ {w}} + \eta I) w = A _ {\pi_ {w}, \mu_ {w}} ^ {\top} C _ {\mu_ {w}} ^ {- 1} b _ {\mu_ {w}}. +$$ + +We defer the proof to Section A.6. Importantly, the $C_0$ here does not depend on $R_{B_1}$ and $R_{B_2}$ . More importantly, the condition on $\| X\|$ (or equivalently, $\eta$ ) in Theorem 5 is only used to fulfill Assumption 3.4, without which $\{\theta_t\}$ in Algorithm 4 still converges to an invariant set of the ODE (10). This condition is to investigate where the iterate converges to instead of whether it converges or not. If we assume $w_0^* \doteq \lim_{\eta \to 0} w_\eta^*$ exists and $A_{\pi_{w_0^*}, \mu_{w_0^*}}$ is invertible, we can see $A_{\pi_{w_0^*}, \mu_{w_0^*}} w_0^* - b_{\mu_{w_0^*}} = \mathbf{0}$ , indicating $w_0^*$ is a TD fixed point. $w_\eta^*$ can therefore be regarded as a regularized TD fixed point, though how the regularization is imposed here (c.f. (13)) is different from that in Algorithm 3 (c.f. (11)). + +Average-reward Setting. Similar to Algorithm 2, introducing a target network and ridge regularization in (5) yields Differential $Q$ -learning with a Target Network (Algorithm 5). Similar to Algorithm 2, $\{B_i\}$ are now balls in $R^{K+1}$ . + +Algorithm 5 Diff. $Q$ -learning with a Target Network +INPUT: $\eta >0,R_{B_1} > R_{B_2} > 0$ +Initialize $[\theta_0^r,\theta_0^{w\top}]^\top \in B_1$ and $S_{0}$ +Sample $A_0\sim \mu (\cdot |S_0)$ +for $t = 0,1,\ldots$ do Execute $A_{t}$ , get $R_{t + 1}$ and $S_{t + 1}$ Sample $A_{t + 1}\sim \mu_{\theta_t^w}(\cdot |S_{t + 1})$ $\delta_t\dot{=} R_{t + 1} - \theta_t^r +\max_{a'}x(S_{t + 1},a')^\top \theta_t^w -x_t^\top w_t$ $w_{t + 1}\doteq w_t + \alpha_t\delta_tx_t - \alpha_t\eta w_t$ $\delta_t^\prime \doteq R_{t + 1} + \max_{a'}x(S_{t + 1},a')^\top \theta_t^w -x_t^\top \theta_t^w -\bar{r}_t$ $\bar{r}_{t + 1}\doteq \bar{r}_t + \alpha_t\delta_t^\prime$ $\begin{array}{r}\left[\begin{array}{l}\theta_{t + 1}^r\\ \theta_{t + 1}^w\end{array}\right]\doteq \Gamma_{B_1}\big(\left[\begin{array}{l}\theta_t^r\\ \theta_t^w\end{array}\right] + \beta_t(\Gamma_{B_2}(\left[ \begin{array}{l}\bar{r}_t\\ w_t\end{array} \right]) - \left[ \begin{array}{l}\theta_t^r\\ \theta_t^w\end{array} \right])\big) \end{array}$ +end for + +Theorem 6. Under Assumptions 2.2, 3.1, 3.5, 5.1, & 5.2, let $L_{\mu}$ denote the Lipschitz constant of $\mu_{\theta}$ , for any $\xi \in (0,1), R_{B_1} > R_{B_2} > R_{B_1} - \xi > 0$ , there exist constants $C_0$ and $C_1$ such that for all $\| X \| < C_0, L_{\mu} < C_1$ , the iterate $\{w_t\}$ generated by Algorithm 5 satisfies + +$$ +\lim _ {t \rightarrow \infty} w _ {t} = w _ {\eta} ^ {*} \quad a l m o s t s u r e l y, +$$ + +where $w_{\eta}^{*}$ is the unique solution of + +$$ +\left(\bar {A} _ {\pi_ {w}, \mu_ {w}} + \eta I\right) w - \bar {b} _ {\mu_ {w}} = \boldsymbol {0} \text {i n s i d e} B _ {1}, \text {w h e r e} +$$ + +$$ +\bar {A} _ {\pi_ {w}, \mu_ {w}} \doteq X (D _ {\mu_ {w}} - d _ {\mu_ {w}} d _ {\mu_ {w}} ^ {\top}) (I - P _ {\pi_ {w}}) X, +$$ + +$$ +\bar {b} _ {\mu_ {w}} \doteq X ^ {\top} (D _ {\mu_ {w}} - d _ {\mu_ {w}} d _ {\mu_ {w}} ^ {\top}) r, +$$ + +and $\pi_w$ is a greedy policy w.r.t. $x(s,\cdot)^\top w$ . + +We defer the proof to Section A.7. Theorem 6 requires $\mu_{\theta}$ to be sufficiently smooth, which is a standard assumption even in the on-policy setting (e.g., Melo et al. (2008); Zou et al. (2019)). It is easy to see that if (5) converges, it converges to a solution of $\bar{A}_{\pi_w,\mu_w}w - \bar{b}_{\mu_w} = \mathbf{0}$ , which we call a TD fixed point for control in the average-reward setting. Theorem 6, which shows that Algorithm 5 finds a regularized TD fixed point, is to the best of our knowledge the first theoretical study for linear $Q$ -learning in the average-reward setting. + +# 6. Experiments + +All the implementations are publicly available. + +We first use Kolter's example (Kolter, 2011) to investigate how $\eta$ influences the performance of $w_{\eta}^{*}$ in the policy evaluation setting. Details are provided in Section D.1. This example is a two-state MDP with small representation error (i.e., $\| \Pi_{D_{\mu}}v_{\pi} - v_{\pi}\|$ is small). We vary the sampling probability of one state $(d_{\mu}(s_1))$ and compute corresponding $w_{\eta}^{*}$ analytically. Figure 1a shows that with $\eta = 0$ , the performance of $w_{\eta}^{*}$ becomes arbitrarily poor when $d_{\mu}(s_1)$ approaches around 0.71. With $\eta = 0.01$ , the spike exists as well. If we further increase $\eta$ to 0.02 and 0.03, the performance for $w_{\eta}^{*}$ becomes well bounded. This confirms the potential advantage of the regularized TD fixed points. + +We then use Baird's example (Baird, 1995) to empirically investigate the convergence of the algorithms we propose. We use exactly the same setup as Chapter 11.2 of Sutton & Barto (2018). Details are provided in Section D.2. In particular, we consider three settings: policy evaluation (Figure 1b), control with a fixed behavior policy (Figure 1c), and control with an action-value dependent behavior policy (Figure 1d). For the policy evaluation setting, we compare a TD version of Algorithm 1 and standard Off-Policy Linear TD (possibly with ridge regularization). For the two control settings, we compare Algorithm 3 with standard linear $Q$ -learning (possibly with ridge regularization). We use constant learning rates and do not use any projection in all the compared algorithms. The exact update rules are provided in Section D.2. Interestingly, Figures 1b-d show that even with $\eta = 0$ , i.e., no ridge regularization, our algorithms with target network still converge in the tested domains. By contrast, without a target network, even when mild regularization is imposed, standard off-policy algorithms still diverge. This confirms the importance of the target network. + +![](images/5128ea28e5464a2da82739496c7a10d81a68326c5b235f262b3a4f2b8bc40cf6.jpg) +(a) + +![](images/6523a51fd63a3e045d27994a3daf09f739b2f263b3db13c9332ba8358802503d.jpg) +(b) +Figure 1. (a) Effect of regularization on Kolter's example. $v_{\pi}$ is the true state-value function. (b) Policy evaluation on Baird's example. (c) Control on Baird's example with a fixed behavior policy. (d) Control on Baird's example with an action-value-dependent behavior policy. In (b)(c)(d), the curves are averaged over 30 independent runs with shaded region indicating one standard deviation. $q_{*}$ is the optimal action-value function. $\eta$ is the weight for the ridge term. Those marked "ours" are curves of algorithms we propose; those marked "standard" are standard semi-gradient off-policy algorithms. Interestingly, the three "standard" curves overlap and get unbounded quickly. + +![](images/654ed0278ed2ece8c9126df934034772b9239c3f5c3c6f04fb4c27132dee654f.jpg) +(c) + +![](images/37660fc75c68f9a1032edcba27c016fb8997b07aa43142d4373b085fe2370732.jpg) +(d) + +# 7. Discussion and Related Work + +For all the algorithms we propose, both the target network and the ridge regularization are at play. One may wonder if it is possible to ensure convergence with only ridge regularization without the target network. In the policy evaluation setting, the answer is affirmative. Applying ridge regularization in (2) directly yields + +$$ +w _ {t + 1} \leftarrow w _ {t} + \alpha_ {t} \delta_ {t} x _ {t} - \alpha_ {t} \eta w _ {t}, \tag {14} +$$ + +where $\delta_t$ is defined in (2). The expected update of (14) is + +$$ +\begin{array}{l} \Delta_ {w} \dot {=} b - (A + \eta I) w \\ \stackrel {.} {=} b - X ^ {\top} D _ {\mu} X w + \gamma X ^ {\top} D _ {\mu} (P _ {\pi} X w) - \eta w. \\ \end{array} +$$ + +If its Jacobian w.r.t. $w$ , denoted as $J_{w}(\Delta_{w})$ , is negative definite, the convergence of $\{w_t\}$ is expected (see, e.g., Section 5.5 of Vidyasagar (2002)). This negative definiteness can be easily achieved by ensuring $\eta > \|X\|^2 \|D_{\mu}(I - \gamma P_{\pi})\|$ (see Diddigi et al. (2019) for similar techniques). This direct ridge regularization, however, would not work in the control setting. Consider, for example, linear $Q$ -learning with ridge regularization (i.e., (14) with $\delta_t$ defined in (4)). The Jacobian of its expected update is $J_w(b_{\mu_w} - (A_{\pi_w, \mu_w} + \eta I)w)$ . It is, however, not clear how to ensure this Jacobian is negative definite by tuning $\eta$ . By using a target network for bootstrapping, $P_{\pi}Xw$ becomes $P_{\pi}X\theta$ . So $J_{w}(\Delta_{w})$ becomes $-J_{w}(X^{\top}D_{\mu}Xw + \eta w)$ , which is always negative definite. Similarly, $J_{w}(b_{\mu_w} - (A_{\pi_w, \mu_w} + \eta)w)$ becomes $-J_{w}(X^{\top}D_{\mu_\theta}Xw + \eta w)$ in Algorithm 3, which is always negative definite regardless of $\theta$ . The convergence of the main network $\{w_t\}$ can, therefore, be expected. The convergence of the target network $\{\theta_t\}$ is then delegated to Theorem 1. Now it is clear that in the deadly triad setting, the target network stabilizes training by ensuring the Jacobian of the expected update is negative definite. One may also wonder if it is possible to ensure convergence with only the target network without ridge regularization. The + +answer is unclear. In our analysis, the conditions on $\| X\|$ (or equivalently, $\eta$ ) are only sufficient and not necessarily necessary. We do see in Figure 1 that even with $\eta = 0$ , our algorithms still converge in the tested domains. How small $\eta$ can be in general and under what circumstances $\eta$ can be 0 are still open problems, which we leave for future work. Further, ridge regularization usually affects the convergence rate of the algorithm, which we also leave for future work. + +In this paper, we investigate target network as one possible solution for the deadly triad. Other solutions include Gradient TD methods (Sutton et al. (2009b;a; 2016) for the discounted setting; Zhang et al. (2021) for the average-reward setting) and Emphatic TD methods (Sutton et al. (2016) for the discounted setting). Other convergence results of $Q$ -learning with function approximation include Tsitsiklis & Van Roy (1996); Szepesvári & Smart (2004), which require special approximation architectures, Wen & Van Roy (2013); Du et al. (2020), which consider deterministic MDPs, Li et al. (2011); Du et al. (2019), which require a special oracle to guide exploration, Chen et al. (2019a), which require matrix inversion every time step, and Wang et al. (2019); Yang & Wang (2019; 2020); Jin et al. (2020), which consider linear MDPs (i.e., both $p$ and $r$ are assumed to be linear). Achiam et al. (2019) characterize the divergence of $Q$ -learning with nonlinear function approximation via Taylor expansions and use preconditioning to empirically stabilize training. Van Hasselt et al. (2018) empirically study the role of a target network in the deadly triad setting in deep RL, which is complementary to our theoretical analysis. + +Regularization is also widely used in RL. Yu (2017) introduce a general regularization term to improve the robustness of Gradient TD algorithms. Du et al. (2017) use ridge regularization in MSPBE to improve its convexity. Zhang et al. (2020) use ridge regularization to stabilize the training of critic in an off-policy actor-critic algorithm. Kolter & Ng + +(2009); Johns et al. (2010); Petrik et al. (2010); Painter-Wakefield et al. (2012); Liu et al. (2012) use Lasso regularization in policy evaluation, mainly for feature selection. + +# 8. Conclusion + +In this paper, we proposed and analyzed a novel target network update rule, with which we improved several linear RL algorithms that are known to diverge previously due to the deadly triad. Our analysis provided a theoretical understanding, in the deadly triad setting, of the conventional wisdom that a target network stabilizes training. A possibility for future work is to introduce nonlinear function approximation, possibly over-parameterized neural networks, into our analysis. + +# Acknowledgments + +SZ is generously funded by the Engineering and Physical Sciences Research Council (EPSRC). SZ was also partly supported by DeepDrive. Inc from September to December 2020 during an internship. This project has received funding from the European Research Council under the European Union's Horizon 2020 research and innovation programme (grant agreement number 637713). The experiments were made possible by a generous equipment grant from NVIDIA. + +# References + +Achiam, J., Knight, E., and Abbeel, P. Towards characterizing divergence in deep q-learning. arXiv preprint arXiv:1903.08894, 2019. +Baird, L. Residual algorithms: Reinforcement learning with function approximation. Machine Learning, 1995. +Borkar, V. S. Stochastic approximation: a dynamical systems viewpoint. Springer, 2009. +Boyan, J. A. Least-squares temporal difference learning. In Proceedings of the 16th International Conference on Machine Learning, 1999. +Cai, Q., Yang, Z., Lee, J. D., and Wang, Z. Neural temporal-difference and q-learning provably converge to global optima. arXiv preprint arXiv:1905.10027, 2019. +Carvalho, D., Melo, F. S., and Santos, P. A new convergent variant of q-learning with linear function approximation. Advances in Neural Information Processing Systems, 33, 2020. +Chen, S., Devraj, A. M., Bušić, A., and Meyn, S. Zap q-learning with nonlinear function approximation. arXiv preprint arXiv:1910.05405, 2019a. + +Chen, Z., Zhang, S., Doan, T. T., Clarke, J.-P., and Maguluri, S. T. Finite-sample analysis of nonlinear stochastic approximation with applications in reinforcement learning. arXiv preprint arXiv:1905.11425, 2019b. +Diddigi, R. B., Kamanchi, C., and Bhatnagar, S. A convergent off-policy temporal difference algorithm. arXiv preprint arXiv:1911.05697, 2019. +Du, S. S., Chen, J., Li, L., Xiao, L., and Zhou, D. Stochastic variance reduction methods for policy evaluation. In Proceedings of the 34th International Conference on Machine Learning, 2017. +Du, S. S., Luo, Y., Wang, R., and Zhang, H. Provably efficient q-learning with function approximation via distribution shift error checking oracle. In Advances in Neural Information Processing Systems, 2019. +Du, S. S., Lee, J. D., Mahajan, G., and Wang, R. Agnostic $q$ -learning with function approximation in deterministic systems: Near-optimal bounds on approximation error and sample complexity. Advances in Neural Information Processing Systems, 2020. +Dulac-Arnold, G., Mankowitz, D., and Hester, T. Challenges of real-world reinforcement learning. arXiv preprint arXiv:1904.12901, 2019. +Fan, J., Wang, Z., Xie, Y., and Yang, Z. A theoretical analysis of deep q-learning. In Learning for Dynamics and Control. PMLR, 2020. +Fujimoto, S., van Hoof, H., and Meger, D. Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477, 2018. +Haarnoja, T., Zhou, A., Abbeel, P., and Levine, S. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018. +Jin, C., Yang, Z., Wang, Z., and Jordan, M. I. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pp. 2137-2143. PMLR, 2020. +Johns, J., Painter-Wakefield, C., and Parr, R. Linear complementarity for regularized policy evaluation and improvement. Advances in neural information processing systems, 2010. +Kolter, J. Z. The fixed points of off-policy td. In Advances in Neural Information Processing Systems, 2011. +Kolter, J. Z. and Ng, A. Y. Regularization and feature selection in least-squares temporal difference learning. In Proceedings of the 26th annual international conference on machine learning, 2009. + +Konda, V. R. Actor-critic algorithms. PhD thesis, Massachusetts Institute of Technology, 2002. +Kushner, H. and Yin, G. G. Stochastic approximation and recursive algorithms and applications. Springer Science & Business Media, 2003. +Lee, D. and He, N. A unified switching system perspective and ode analysis of q-learning algorithms. arXiv preprint arXiv:1912.02270, 2019. +Li, L., Littman, M. L., Walsh, T. J., and Strehl, A. L. Knows what it knows: a framework for self-aware learning. Machine learning, 2011. +Lillicrap, T. P., Hunt, J. J., Pritzel, A., Heess, N., Erez, T., Tassa, Y., Silver, D., and Wierstra, D. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. +Lin, L.-J. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine Learning, 1992. +Liu, B., Mahadevan, S., and Liu, J. Regularized off-policy td-learning. Advances in Neural Information Processing Systems, 2012. +Maei, H. R., Szepesvári, C., Bhatnagar, S., and Sutton, R. S. Toward off-policy learning control with function approximation. In Proceedings of the 27th International Conference on Machine Learning, 2010. +Marbach, P. and Tsitsiklis, J. N. Simulation-based optimization of markov reward processes. IEEE Transactions on Automatic Control, 2001. +Melo, F. S., Meyn, S. P., and Ribeiro, M. I. An analysis of reinforcement learning with function approximation. In Proceedings of the 25th International Conference on Machine Learning, 2008. +Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., et al. Human-level control through deep reinforcement learning. Nature, 2015. +Painter-Wakefield, C., Parr, R., and Durham, N. L1 regularized linear temporal difference learning. Technical report: Department of Computer Science, Duke University, Durham, NC, TR-2012-01, 2012. +Petrik, M., Taylor, G., Parr, R., and Zilberstein, S. Feature selection using regularization in approximate linear programs for markov decision processes. arXiv preprint arXiv:1005.1860, 2010. + +Puterman, M. L. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014. +Silver, D., Huang, A., Maddison, C. J., Guez, A., Sifre, L., Van Den Driessche, G., Schrittwieser, J., Antonoglou, I., Panneershelvam, V., Lanctot, M., et al. Mastering the game of go with deep neural networks and tree search. Nature, 2016. +Sutton, R. S. Learning to predict by the methods of temporal differences. Machine Learning, 1988. +Sutton, R. S. and Barto, A. G. Reinforcement Learning: An Introduction (2nd Edition). MIT press, 2018. +Sutton, R. S., Maei, H. R., Precup, D., Bhatnagar, S., Silver, D., Szepesvari, C., and Wiewiora, E. Fast gradient-descent methods for temporal-difference learning with linear function approximation. In Proceedings of the 26th International Conference on Machine Learning, 2009a. +Sutton, R. S., Maei, H. R., and Szepesvári, C. A convergent $o(n)$ temporal-difference algorithm for off-policy learning with linear function approximation. In Advances in Neural Information Processing Systems, 2009b. +Sutton, R. S., Modayil, J., Delp, M., Degris, T., Pilarski, P. M., White, A., and Precup, D. Horde: A scalable real-time architecture for learning knowledge from unsupervised sensorimotor interaction. In Proceedings of the 10th International Conference on Autonomous Agents and Multiagent Systems, 2011. +Sutton, R. S., Mahmood, A. R., and White, M. An emphatic approach to the problem of off-policy temporal-difference learning. The Journal of Machine Learning Research, 2016. +Szeptésvári, C. and Smart, W. D. Interpolation-based q-learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 100, 2004. +Tikhonov, A. N., Goncharsky, A., Stepanov, V., and Yagola, A. G. Numerical methods for the solution of ill-posed problems. Springer Science & Business Media, 2013. +Tsitsiklis, J. N. and Van Roy, B. Feature-based methods for large scale dynamic programming. Machine Learning, 1996. +Tsitsiklis, J. N. and Van Roy, B. Analysis of temporal-difference learning with function approximation. In Advances in Neural Information Processing Systems, 1997. +Van Hasselt, H., Doron, Y., Strub, F., Hessel, M., Sonnerat, N., and Modayil, J. Deep reinforcement learning and the deadly triad. arXiv preprint arXiv:1812.02648, 2018. + +Vidyasagar, M. Nonlinear systems analysis. SIAM, 2002. +Wan, Y., Naik, A., and Sutton, R. S. Learning and planning in average-reward markov decision processes. arXiv preprint arXiv:2006.16318, 2020. +Wang, Y. and Zou, S. Finite-sample analysis of greedy-gq with linear function approximation under markovian noise. arXiv preprint arXiv:2005.10175, 2020. +Wang, Y., Wang, R., Du, S. S., and Krishnamurthy, A. Optimism in reinforcement learning with generalized linear function approximation. arXiv preprint arXiv:1912.04136, 2019. +Watkins, C. J. and Dayan, P. Q-learning. Machine Learning, 1992. +Wen, Z. and Van Roy, B. Efficient exploration and value function generalization in deterministic systems. Advances in Neural Information Processing Systems, 2013. +Wu, Y., Zhang, W., Xu, P., and Gu, Q. A finite time analysis of two time-scale actor critic methods. arXiv preprint arXiv:2005.01350, 2020. +Xu, P. and Gu, Q. A finite-time analysis of q-learning with neural network function approximation. In International Conference on Machine Learning, pp. 10555-10565. PMLR, 2020. +Yang, L. and Wang, M. Reinforcement learning in feature space: Matrix bandit, kernels, and regret bound. In International Conference on Machine Learning, pp. 10746-10756. PMLR, 2020. +Yang, L. F. and Wang, M. Sample-optimal parametric q-learning using linearly additive features. arXiv preprint arXiv:1902.04779, 2019. +Yang, Z., Fu, Z., Zhang, K., and Wang, Z. Convergent reinforcement learning with function approximation: A bilevel optimization perspective, 2019. URL https://openreview.net/forum?id=ryfcCo0ctQ. +Yu, H. Convergence of least squares temporal difference methods under general conditions. In ICML, 2010. +Yu, H. On convergence of some gradient-based temporal-differences algorithms for off-policy learning. arXiv preprint arXiv:1712.09652, 2017. +Zhang, S., Liu, B., Yao, H., and Whiteson, S. Provably convergent two-timescale off-policy actor-critic with function approximation. In Proceedings of the 37th International Conference on Machine Learning, 2020. +Zhang, S., Wan, Y., Sutton, R. S., and Whiteson, S. Average-reward off-policy policy evaluation with function approximation. arXiv preprint arXiv:2101.02808, 2021. + +Zou, S., Xu, T., and Liang, Y. Finite-sample analysis for sarsa with linear function approximation. In Advances in Neural Information Processing Systems, 2019. \ No newline at end of file diff --git a/breakingthedeadlytriadwithatargetnetwork/images.zip b/breakingthedeadlytriadwithatargetnetwork/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4dea174ad9367b3c52ec0ee9356e3920dc6987c --- /dev/null +++ b/breakingthedeadlytriadwithatargetnetwork/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:916370c8676e6c6d545c44488ab012dee4b0998f3a6f6fa5f0466151d8aa9d07 +size 233160 diff --git a/breakingthedeadlytriadwithatargetnetwork/layout.json b/breakingthedeadlytriadwithatargetnetwork/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4d4e1d586d9b6e65aac08d0303de4f3b50ddb306 --- /dev/null +++ b/breakingthedeadlytriadwithatargetnetwork/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad69f3a8a991a0e08c3b3d5815799b788bdbd5619ea2d87ef8bc7e31c6dce58d +size 763089 diff --git a/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_content_list.json b/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..53652ee481c23a252b21b41d3c7525963259d85f --- /dev/null +++ b/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:139ac5588b207218ae7a9b5a4c9711638819f9c991c1c2be586aab0c2a611fb9 +size 79933 diff --git a/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_model.json b/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9c059f3bc46cd69022849428d277bc64862a9793 --- /dev/null +++ b/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079ad24c4a01535b165938565410910646709c47d63d60b253d97bac03d7a1a5 +size 96870 diff --git a/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_origin.pdf b/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0f21b42a5997cc466e1cdd597ad0dc055e09eb48 --- /dev/null +++ b/breakingthelimitsofmessagepassinggraphneuralnetworks/278b2efa-3056-4d4a-bc0b-60d9f2650bce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbe3227d3ac4cc56233b994a9b855c454fbbbe2cb90d2b329983438f777379c9 +size 516785 diff --git a/breakingthelimitsofmessagepassinggraphneuralnetworks/full.md b/breakingthelimitsofmessagepassinggraphneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..aceed103520f494fb5618f9d5dc9d8d354f23a0e --- /dev/null +++ b/breakingthelimitsofmessagepassinggraphneuralnetworks/full.md @@ -0,0 +1,308 @@ +# Breaking the Limits of Message Passing Graph Neural Networks + +Muhammet Balcilar $^{12}$ Pierre Héroux $^{1}$ Benoit Gaüzère $^{3}$ Pascal Vasseur $^{14}$ Sébastien Adam $^{1}$ Paul Honeine $^{1}$ + +# Abstract + +Since the Message Passing (Graph) Neural Networks (MPNNs) have a linear complexity with respect to the number of nodes when applied to sparse graphs, they have been widely implemented and still raise a lot of interest even though their theoretical expressive power is limited to the first order Weisfeiler-Lehman test (1-WL). In this paper, we show that if the graph convolution supports are designed in spectral-domain by a nonlinear custom function of eigenvalues and masked with an arbitrary large receptive field, the MPNN is theoretically more powerful than the 1-WL test and experimentally as powerful as a 3-WL existing models, while remaining spatially localized. Moreover, by designing custom filter functions, outputs can have various frequency components that allow the convolution process to learn different relationships between a given input graph signal and its associated properties. So far, the best 3-WL equivalent graph neural networks have a computational complexity in $\mathcal{O}(n^3)$ with memory usage in $\mathcal{O}(n^2)$ , consider non-local update mechanism and do not provide the spectral richness of output profile. The proposed method overcomes all these aforementioned problems and reaches state-of-the-art results in many downstream tasks. + +# 1. Introduction + +In the past few years, finding the best inductive bias for relational data represented as graphs has gained a lot of interest in the machine learning community. Node-based message passing mechanisms relying on the graph structure have given rise to the first generation of Graph Neural Networks (GNNs) called Message Passing Neural Networks (MPNNs) (Gilmer et al., 2017). These algorithms spread each node features to the neighborhood nodes using train- + +able weights. These weights can be shared with respect to the distance between nodes (Chebnet GNN) (Defferrard et al., 2016), to the connected nodes features (GAT for graph attention network) (Velicković et al., 2018) and/or to edge features (Bresson & Laurent, 2018). When considering sparse graphs, the memory and computational complexity of such approaches are linear with respect to the number of nodes. As a consequence, these algorithms are feasible for large sparse graphs and thus have been applied with success on many downstream tasks (Dwivedi et al., 2020). + +Despite these successes and these interesting computational properties, it has been shown that MPNNs are not powerful enough (Xu et al., 2019). Considering two non-isomorphic graphs that are not distinguishable by the first order Weisfeiler-Lehman test (known as the 1-WL test), existing maximum powerful MPNNs embed them to the same point. Thus, from a theoretical expressive power point of view, these algorithms are not more powerful than the 1-WL test. Beyond the graph isomorphism issue, it has also been shown that many other combinatorial problems on graph cannot be solved by MPNNs (Sato et al., 2019). + +In (Maron et al., 2019b; Keriven & Peyré, 2019), it has been proven that in order to reach universal approximation, higher order relations are required. In this context, some powerful models that are equivalent to the 3-WL test were proposed. For instance, (Maron et al., 2019a) proposed the model PPGN (Provably Powerful Graph Network) that mimics the second order Folklore WL test (2-FWL), which is equivalent to the 3-WL test. In (Morris et al., 2019), they proposed to use message passing between 1, 2 and 3 order node tuples hierarchically, thus reaching the 3-WL expressive power. However, using such relations makes both memory usage and computational complexities grown exponentially. Thus, it is not feasible to have universal approximation models in practice. + +In order to increase the theoretical expressive power of MPNNs by keeping the linear complexity mentioned above, some researchers proposed to partly randomize node features (Abboud et al., 2020; Sato et al., 2020) or to add a unique label (Murphy et al., 2019) in order to have the ability to distinguish two non-isomorphic graphs that are not distinguished by the 1-WL test. These solutions need massively training samples and involve slow convergence. + +(Bouritsas et al., 2020; Dasoulas et al., 2020) proposed to use a preprocessing step to extract some features that cannot be extracted by MPNNs. Thus, the expressive power of their GNN is improved. However, these handcrafted features need domain expertise and a feature selection process among an infinite number of possibilities. + +All these studies target more theoretically powerful models, closer to universal approximation. However, this does not always induce a better generalization ability. Since most of the realistic problems are given with many node/edge features (which can be either continuous or discrete), there is almost no pair of graphs that are not distinguishable by the 1-WL test in practice. In addition, theoretically more powerful methods use non-local updates, breaking one of the most important inductive bias in Euclidean learning named locality principle (Battaglia et al., 2018). These may explain why theoretical powerful methods cannot outperform MPNNs on many downstream tasks, as reported in (Dwivedi et al., 2020). On the other hand, it is obvious that 1-WL equivalent GNNs are not expressive enough since they are not able to count some simple structural features such as cycles or triangles (Arvind et al., 2020; Chen et al., 2020; Bouritsas et al., 2020; Vignac et al., 2020), which are informative for some social or chemical graphs. Finally, another important aspect mentioned by a recent paper (Balcilar et al., 2021) concerns the spectral ability of GNN models. It is shown that a vast majority of the MPNNs actually work as low-pass filters, thus reducing their expressive power. + +In this paper, we propose to design graph convolution in the spectral domain with custom non-linear functions of eigenvalues and by masking the convolution support with desired length of receptive field. In this way, we have (i) a spatially local updates process, (ii) linear memory and computational complexities (except the eigendecomposition in preprocessing step), (iii) enough spectral ability and (iv) a model that is theoretically more powerful than the 1-WL test, and experimentally as powerful as PPGN. Experiments show that the proposed model can distinguish pairs of graphs that cannot be distinguished by 1-WL equivalent MPNNs. It is also able to count some substructures that 1-WL equivalent MPNNs cannot. Its spectral ability enables to produce various kinds of spectral components in the output, while the vast majority of the GNNs including higher order WL equivalent models do not. Finally, thanks to the sparse matrix multiplication, it has linear time complexity except the eigendecomposition in preprocessing step. + +The paper is structured as follows. In Section 2, we set the notations and the general framework used in the following. Section 3 is dedicated to the characterization of WL test, which is the backbone of our theoretical analysis. It is followed by our findings in Section 4 on analysing the expressive power of MPNNs and our solutions to improve + +expressive power of MPNNs in Section 5. The experimental results and conclusion are the last two sections of this paper. + +# 2. Generalization of Spectral and Spatial MPNN + +Let $G$ be a graph with $n$ nodes and an arbitrary number of edges. Connectivity is given by the adjacency matrix $A \in \{0,1\}^{n \times n}$ and features are defined on nodes by $X \in \mathbb{R}^{n \times f_0}$ , with $f_0$ the length of feature vectors. For any matrix $X$ , we used $X_i$ , $X_{i,j}$ and $X_{i,j}$ to refer to its $i$ -th column vector, $j$ -th row vector and $(i,j)$ -th entry, respectively. A graph Laplacian is given by $L = D - A$ (or $L = I - D^{-1/2}AD^{-1/2}$ ) where $D \in \mathbb{R}^{n \times n}$ is the diagonal degree matrix and $I$ is the identity. Through an eigendecomposition, $L$ can be written by $L = U\text{diag}(\boldsymbol{\lambda})U^T$ where each column of $U \in \mathbb{R}^{n \times n}$ is an eigenvector of $L$ , $\boldsymbol{\lambda} \in \mathbb{R}^n$ gathers the eigenvalues of $L$ and $\text{diag}(\cdot)$ creates a diagonal matrix whose diagonal elements are from a given vector. We use superscripts to refer to vectors or matrices evolving through iterations or layers. For instance, $H^{(l)} \in \mathbb{R}^{n \times f_l}$ refers to the node representation on layer $l$ whose feature dimension is $f_l$ . + +GNN models rely on a set of layers where each layer takes the node representation of the previous layer $H^{(l-1)}$ as input and produces a new representation $H^{(l)}$ , with $H^{(0)} = X$ . According to the domain which is considered to design the layer computations, GNNs are generally classified as either spectral or spatial (Wu et al., 2019; Chami et al., 2020). Spectral GNNs rely on the spectral graph theory (Chung, 1997). In this framework, signals on graphs are filtered using the eigendecomposition of the graph Laplacian (Shuman et al., 2013). By transposing the convolution theorem to graphs, the spectral filtering in the frequency domain can be defined by $x_{fft} = U\mathrm{diag}(\Omega(\lambda))U^\top x$ , where $\Omega(.)$ is the desired filter function which needs to be learnt by backpropagation. On the other hand, spatial GNNs, such as GCN (graph convolutional network) (Kipf & Welling, 2017) and GraphSage (Hamilton et al., 2017), consider two operators, one that aggregates the connected nodes messages and one that updates the concerned node representation. + +In a recent paper (Balcilar et al., 2021), it was explicitly shown that both spatial and spectral GNNs are MPNN, taking the general form + +$$ +H ^ {(l + 1)} = \sigma \left(\sum_ {s} C ^ {(s)} H ^ {(l)} W ^ {(l, s)}\right), \tag {1} +$$ + +where $C^{(s)} \in \mathbb{R}^{n \times n}$ is the $s$ -th convolution support that defines how the node features are propagated to the neighboring nodes and $W^{(l,s)} \in \mathbb{R}^{f_l \times f_{l+1}}$ is the trainable matrix for the $l$ -th layer and $s$ -th support. Within this generalization, GNNs differ from each other by the design of the convolution supports $C^{(s)}$ . If the supports are designed in the + +spectral domain by $\Phi_s(\lambda)$ , the convolution support needs to be written as $C^{(s)} = U\mathrm{diag}(\Phi_s(\lambda))U^\top$ + +One can see that as long as $C^{(s)}$ matrices are sparse (number of edges is defined by some constant multiplied by the number of nodes), MPNN in Eq.1 has linear memory and computational complexities with respect to the number of nodes. Because, the valid entries in $C^{(s)}$ that we need to keep is linear with respect to the number of nodes and thank to the sparse matrix multiplication $C^{(s)}H^{(l)}$ takes linear time with respect to the number of edges thus nodes as well. + +# 3. Characterization of Weisfeiler-Lehman + +The universality of a GNN is based on its ability to embed two non-isomorphic graphs to distinct points in the target feature space. A model that can distinguish all pairs of nonisomorphic graphs is a universal approximator. Since the graph isomorphism problem is NP-intermediate (Takapoui & Boyd, 2016), the Weisfeiler-Lehman Test (abbreviated WL-test), which gives sufficient but not enough evidence of graph isomorphism, is frequently used for characterizing GNN expressive power. The classical vertex coloring WL test can be extended by taking into account higher order of node tuple within the iterative process. These extensions are denoted as $k$ -WL test, where $k$ is equals to the order of the tuple. These tests are described in Appendix A. + +It is shown in (Arvind et al., 2020) that for $k \geq 2$ , $(k + 1)$ -WL $> (k)$ -WL, i.e., higher order of tuple leads to a better ability to distinguish two non-isomorphic graphs. For $k = 1$ , this statement is not true, and 2-WL is not more powerful than 1-WL (Maron et al., 2019a). To clarify this point, the Folkore WL (FWL) test has been defined such that 1-WL=1-FWL, but for $k \geq 2$ , we have $(k + 1)$ -WL $\approx (k)$ -FWL (Maron et al., 2019a). + +In literature, some confusions occur among the two versions. Some papers use WL test order (Morris et al., 2019; Maron et al., 2019a), while others use FWL order under the name of WL such as in (Abboud et al., 2020; Arvind et al., 2020; Takapoui & Boyd, 2016). In this paper, we explicitly mention both WL and FWL equivalent. + +In order to better understand the capability of WL tests, some papers attempt to characterize these tests using a first order logic (Immerman & Lander, 1990; Barceló et al., 2019). Consider two unlabeled and undirected graphs represented by their adjacency matrices $A_{G}$ and $A_{H}$ . These two graphs are said $k$ -WL (or $k$ -FWL) equivalent, and denoted $A_{G} \equiv_{k-WL} A_{H}$ , if they are indistinguishable by a $k$ -WL (or $k$ -FWL) test. + +Recently (Brijder et al., 2019; Geerts, 2020) proposed a new Matrix Language called MATLAB. This language includes different operations on matrices and makes some + +explicit connections between specific dictionaries of operations and the 1-WL and 3-WL tests. Expressive power varies with the operations included in each dictionary. + +Definition 1. $ML(\mathcal{L})$ is a matrix language with an allowed operation set $\mathcal{L} = \{op_1, \ldots, op_n\}$ , where $op_i \in \{., +, \top, diag, tr, 1, \odot, \times, f\}$ . The possible operations are matrices multiplication and addition, matrix transpose, vector diagonalization, matrix trace computation, column vector full of 1, element-wise matrix multiplication, matrix/scalar multiplication and element-wise custom function operating on scalars or vectors. + +Definition 2. $e(X) \in \mathbb{R}$ is a sentence in $ML(\mathcal{L})$ if it consists of any possible consecutive operations in $\mathcal{L}$ , operating on a given matrix $X$ and resulting in a scalar value. + +As an example, $e(X) = \mathbf{1}^{\top}X^{2}\mathbf{1}$ is a sentence of $ML(\mathcal{L})$ with $\mathcal{L} = \{.,^{\top},\mathbf{1}\}$ , computing the sum of all elements of square matrix $X$ . In the following, we are interested in languages $\mathcal{L}_1, \mathcal{L}_2$ and $\mathcal{L}_3$ that have been used for characterizing the WL-test in (Geerts, 2020). These results are given next. + +Remark 1. Two adjacency matrices are indistinguishable by the 1-WL test if and only if $e(A_G) = e(A_H)$ for all $e \in \mathcal{L}_1$ with $\mathcal{L}_1 = \{.,^\top, 1, \text{diag}\}$ . Hence, all possible sentences in $\mathcal{L}_1$ are the same for 1-WL equivalent adjacency matrices. Thus, $A_G \equiv_{1 - WL} A_H \leftrightarrow A_G \equiv_{ML(\mathcal{L}_1)} A_H$ . (see Theorem 7.1 in (Geerts, 2020)) + +Remark 2. $ML(\mathcal{L}_2)$ with $\mathcal{L}_2 = \{.,^\top, 1, \text{diag}, \text{tr}\}$ is strictly more powerful than $\mathcal{L}_1$ , i.e., than the 1-WL test, but less powerful than the 3-WL test. (see Theorem 7.2 and Example 7.3 in (Geerts, 2020)) + +Remark 3. Two adjacency matrices are indistinguishable by the 3-WL test if and only if they are indistinguishable by any sentence in $ML(\mathcal{L}_3)$ with $\mathcal{L}_3 = \{.,^\top, 1, \text{diag}, \text{tr}, \odot\}$ . Thus, $A_G \equiv_{3-WL} A_H \leftrightarrow A_G \equiv_{ML(\mathcal{L}_3)} A_H$ . (see Theorem 9.2 in (Geerts, 2020)) + +Remark 4. Enriching the operation set to $\mathcal{L}^{+} = \mathcal{L}\cup$ $\{+, \times, f\}$ where $\mathcal{L} \in (\mathcal{L}_1, \mathcal{L}_2, \mathcal{L}_3)$ does not improve the expressive power of the language. Thus, $A_G \equiv_{ML(\mathcal{L})} A_H \leftrightarrow A_G \equiv_{ML(\mathcal{L}^+)} A_H$ . (see Proposition 7.5 in (Geerts, 2020)) + +# 4. How Powerful are MPNNs? + +This section presents some results about the theoretical expressive power of state-of-the-art MPNNs. Those results are derived using the MATLAB language (Geerts, 2020) and more precisely the remarks of the preceding section. Proofs of the theorems are given in Appendix B. + +Theorem 1. MPNNs such as GCN, GAT, GraphSage, GIN (defined in Appendix H) cannot go further than operations in $\mathcal{L}_1^+$ . Thus, they are not more powerful than the 1-WL test. + +This result has already been given in (Xu et al., 2019), which proposed GIN- $\epsilon$ (GIN for Graph Isomorphism Network) and + +showed that it is the unique MPNN which is provably exact the same powerful with the 1-WL test, while the rest of MPNNs are known to be less powerful than 1-WL test. + +Chebnet is also known to be not more powerful than the 1-WL test. However, the next theorem states that it is true if the maximum eigenvalues are the same for both graphs. For a pair of graphs whose maximum eigenvalues are not equal, Chebnet is strictly more powerful than the 1-WL test. + +Theorem 2. Chebnet is more powerful than the 1-WL test if the Laplacian maximum eigenvalues of the non-regular graphs to be compared are not the same. Otherwise Chebnet is not more powerful than 1-WL. + +![](images/1c24ef7a63afc070949fda055613685105e7872d53d3be37405c8ecbe352d370.jpg) +Figure 1. Decalin $(G)$ and Bicyclopentyl $(H)$ graphs are $\mathcal{L}_1$ and also 1-WL equivalent, but Chebnet can distinguish them. + +Figure 1 shows two graphs that are 1-WL equivalent and are generally used to show how MPNNs fail. However, their normalized Laplacian's maximum eigenvalues are not the same. Thus, Chebnet can project these two graphs to different points in feature space. Details can be found in Appendix C. + +As stated in the introduction, comparison with the WL-test is not the only way to characterize the expressive power of GNNs. Powerful GNNs are also expected to be able to count relevant substructures in a given graph for specific problems. The following theorems describe the matrix language required to be able to count the graphlets illustrated in Figure 2, which are called 3-star, triangle, tailed triangle and 4-cycle. + +![](images/c50a7db0d0b707a74b0b9109a701f5f80e470fc6dc821a8a7bd11f4e960c9cf4.jpg) +Figure 2. Sample of patterns: 3-star, triangle, tailed triangle and 4-cycle graphlets used in our analysis. + +Theorem 3. 3-star graphlets can be counted by sentences in $\mathcal{L}_1^+$ . + +Theorem 4. Triangle and 4-cycle graphlets can be counted by sentences in $\mathcal{L}_2^+$ . + +Theorem 5. Tailed triangle graphlets can be counted by sentences in $\mathcal{L}_3^+$ . + +These theorems show that 1-WL equivalent MPNNs can only count 3-star patterns, while 3-WL equivalent MPNNs can count all graphlets shown in Figure 2. + +(Dehmamy et al., 2019) has shown that a MPNN is not able to learn node degrees if the MPNN has not an appropriate convolution support (e.g. $A$ ). Therefore, to achieve a fair comparison, we assume that node degrees are included as a node feature. Note however, that the number of 3-star graphlets centered on a node can be directly derived from its degrees (see Appendix B.3). Therefore, any graph agnostic MLP can count the number of 3-star graphlets given the node degree. + +# 5. MPNN Beyond 1-WL + +In this section, we present two new MPNN models. The first one, called GNNML1 is shown to be as powerful as the 1-WL test. The second one, called GNNML3 exploits the theoretical results of (Geerts, 2020) to break the limits of 1-WL and reach 3-WL equivalence experimentally. GNNML1 relies on the node update schema given by: + +$$ +H ^ {(l + 1)} = \sigma \left(H ^ {(l)} W ^ {(l, 1)} + A H ^ {(l)} W ^ {(l, 2)} + H ^ {(l)} W ^ {(l, 3)} \odot H ^ {(l)} W ^ {(l, 4)}\right) \tag {2} +$$ + +where $W^{(l,s)}$ are trainable parameters. Using this model, the new representation of a node consists of a sum of three terms: (i) a linear transformation of the previous layer representation of the node, (ii) a linear transformation of the sum of the previous layer representations of its connected nodes and (iii) the element-wise multiplication of two different linear transformations of the previous layer representation of the node. + +The expressive power of GNNML1 is defined by the following theorem. Its proof is given in Appendix B: + +Theorem 6. GNNML1 can produce every possible sentences in $ML(\mathcal{L}_1)$ for undirected graph adjacency $A$ with monochromatic edges and nodes. Thus, GNNML1 is exactly as powerful as the 1-WL test. + +Hence, this model has the same ability as the 1-WL test to distinguish two non-isomorphic graphs, i.e., the same as GIN. This is explained by the third term in the sum of Eq.(2) since it can produce feature-wise multiplication on each layer. Since node representation is richer, we also assume that it would be more powerful for counting substructures. This assumption is validated by experiments in Section 6. + +To reach more powerful models than 1-WL, theoretical results (see Remarks 1, 2 and 3 in Section 3) show that a model that can produce different outputs than $\mathcal{L}_1^+$ language is needed. More precisely, according to Remarks 2 and 3, trace $(tr)$ and element-wise multiplication $(\odot)$ operations are required to go further than 1-WL. + +In order to illustrate the impact of the trace operation, one can use 1-WL equivalent Decalin and Bicyclopentyl graphs in Figure 1. It is easy to show that $tr(A_G^5) = 0$ but $tr(A_H^5) = 20$ , $tr(A^5)$ giving the number of 5-length closed + +walks. Thus, if a model can apply a trace operator over some power of adjacency, it can easily distinguish these two graphs. Computational details concerning this example are given in Appendix C. + +![](images/7ca59db083c1adead06e152e082473a826408d2306ccd6adf304e60c4f091ea4.jpg) +Figure 3. Cospectral and 4-regular graphs from (Van Dam & Haemers, 2003) are $\mathcal{L}_1$ and $\mathcal{L}_2$ equivalent. + +Despite this interesting property of the trace operator, it is not sufficient to distinguish cospectral graphs, since cospectral graphs (see Figure 3) have the same number of closed walks of any length (see Proposition 5.1 in (Geerts, 2020)). In such cases, element-wise multiplication is useful. As an example, the sentence $e(A) = \mathbf{1}^{\top}f((A\odot A^{2})^{2}\mathbf{1})$ where $f(x) = x\odot x$ for any vector $x$ , gives $e(A_{G}) = 6032$ and $e(A_H) = 5872$ for the graphs of Figure 3. Thus, element-wise multiplication helps distinguishing these two graphs. The calculation details can be found in Appendix D. + +As shown by these examples, a model enriched by element-wise multiplication and trace operator can go further than the 1-WL test. However, these operations need to keep the power of the adjacency matrix explicitly and to multiply these dense matrices to each other by matrix or element-wise multiplication. Such a strategy is actually used by higher order GNNs such as (Maron et al., 2019a; Morris et al., 2019), which are provably more powerful than existing MPNNs. + +However, MPNNs cannot calculate the power of a given adjacency explicitly. Indeed, a MPNN layer multiplies the previous representation of the nodes by sparse adjacency matrix or more generally sparse convolution supports $C$ in Eq.(1). More precisely, if the given node features are $H^{(0)} = 1$ , a MPNN can calculate $C^3\mathbf{1}$ by 3 layered MPNN computing $C(C(C\mathbf{1}))$ but not by $(C^3)\mathbf{1}$ . Since a MPNN does not keep $C^3$ explicitly, it cannot take its trace or multiply element-wise to another power of support. This is a major disadvantage of MPNNs, but it explains why MPNNs need just linear time and memory complexity, making them useful in practice. + +A solution to the problem mentioned above is to design graph convolution supports by the element-wise multiplication of the $s$ -power of the adjacency matrix and a given receptive field, i.e., by $C^{(s)} = M \odot A^s$ where $M$ masks the components of the powered matrix and keeps the convolution support sparse. $M = A + I$ is an example of mask that gives a maximum 1-length receptive field. This model cannot calculate all possible element-wise multiplications between all possible matrices, but it can produce any sentence in a form of $(M \odot A^s)^l$ where $l \in [0, l_{max}]$ is the + +layer number and $s \in [0, s_{max}]$ is the pre-computed power of convolution supports. In this proposition, the receptive field mask and the number of power of adjacency should be computed in a pre-processing step. However, we cannot initially know which power of adjacency matrix is necessary for a given problem. One solution is to tune it as an hyperparameter of the model. Another problem of this approach is that using powers of adjacency makes the convolution supports filled with high values that have to be normalized. + +To overcome these problems, we propose through our GN-NML3 model to design convolution supports in the spectral domain as functions of eigenvalues of the normalized Laplacian matrix or of the adjacency matrix. The following theorem, with proof given in Appendix B, shows that such supports can be written as power series of the graph Laplacian or the adjacency matrix. + +Theorem 7. A convolution support given by + +$$ +C ^ {\prime (s)} = U d i a g \left(\Phi_ {s} (\lambda)\right) U ^ {\top}, \tag {3} +$$ + +where $\Phi_s(\lambda) = \exp(-b(\lambda - f_s)^2)$ , $f_s \in [\lambda_{min}, \lambda_{max}]$ is a scalar design parameter of each convolution support and $b > 0$ is a general scalar design parameter, can be expressed as a linear combination of all powers of graph Laplacian (or adjacency) as follows, with $\alpha_{s,i} = \frac{\Phi_s^{(i)}(0)}{i!}$ : + +$$ +C ^ {\prime (s)} = \alpha_ {s, 0} L ^ {0} + \alpha_ {s, 1} L ^ {1} + \alpha_ {s, 2} L ^ {2} + \dots . \tag {4} +$$ + +Since design parameters $f_{s}$ of each matrix are different, each $C^{\prime (s)}$ in Eq.(4) consists of different linear combinations of power series of the graph Laplacian (or adjacency). Thus, necessary powers of the graph Laplacian (or adjacency) and its diagonal part (for trace operation) can be learned and their element-wise multiplication can be produced by: + +$$ +C = M \odot m l p _ {4} \left(m l p _ {1} \left(C ^ {\prime}\right) \mid m l p _ {2} \left(C ^ {\prime}\right) \odot m l p _ {3} \left(C ^ {\prime}\right)\right), \tag {5} +$$ + +where $C' = [C'^{(1)}|\ldots|C'^{(s)}] \in \mathbb{R}^{n \times n \times S}$ stacks initial convolution supports on the third dimension, $mlp_{k}(.)$ is a trainable model performed on third dimension of a given tensor, $C = [C^{(1)}|\ldots|C^{(S)}] \in \mathbb{R}^{n \times n \times S}$ sparsify convolution support by defined receptive field mask $M$ . The forward calculation of one layer MPNN becomes: + +$$ +H ^ {(l + 1)} = \sigma \left(\sum_ {s} \left(C ^ {(s)} H ^ {(l)} W ^ {(l, s)}\right) \mid m l p _ {5} \left(H ^ {(l)}\right) \odot m l p _ {6} \left(H ^ {(l)}\right)\right) \tag {6} +$$ + +where we concatenate MPNN representation under learned convolution with element-wise product of node representations as in GNNML1. + +There is an infinite number of selections of $\Phi_s(\lambda)$ that make the convolution support written by power series of graph Laplacian (or adjacency). However, we can design each convolution support to be sensitive on each band of spectrum + +# Algorithm 1 GNNML3 Preprocessing Step + +Input: adjacency $A\in \mathbb{R}^{n\times n}$ , receptive field mask $M\in$ $\{0,1\}^{n\times n}$ , number of supports $S\in \mathbb{N}$ , frequency responses function of each support $\Phi_1(\lambda)\dots \Phi_S(\lambda)$ +Output: extracted edge features $C^\prime \in \mathbb{R}^{m\times S}$ +Set basis matrix: $B = I - D^{-1 / 2}AD^{-1 / 2}$ or $B = A$ Eigendecomposition: $Udiag(\lambda)U^{\top} = B$ +for $s = 1$ to $S$ do $C_{:s}^{\prime} = \text{sparse2vec}\left(M\odot (Udiag(\Phi_{s}(\lambda))U^{\top})\right)$ +end for + +# Algorithm 2 GNNML3 Forward calculation + +Input: extracted edge features $C^\prime \in \mathbb{R}^{m\times S}$ , initial node feature $H^{(0)}\in \mathbb{R}^{n\times f_0}$ , receptive field mask $M\in \{0,1\}^{n\times n}$ , number of layers $L$ , number of supports $S$ +Output: new node representation $H^{(L)}$ +for $l = 0$ to $L - 1$ do + $\tilde{C} = ml_{p,l,4}(ml_{p,l,1}(C^{\prime})|ml_{p,l,2}(C^{\prime})\odot ml_{p,l,3}(C^{\prime}))$ +for $s = 1$ to $S$ do + $C^{(s)} = vec2sparse(\tilde{C};s,M)$ +end for + $H^{(l + 1)} = \sigma \big(\sum_s(C^{(s)}H^{(l)}W^{(l,s)})|ml_{p,l,5}(H^{(l)})\odot ml_{p,l,6}(H^{(l)})\big)$ +end for + +$(f_s)$ by given bandwidth $(b)$ . Therefore, our model will be able to learn properties depending on the spectrum of graph signal. + +Algorithm 1 calculates the initial convolution supports $(C^{\prime})$ . Since the supports are computed for valid indices in the receptive field mask (where $M_{i,j} = 1$ ), one can see $C^\prime$ as extracted edge features where the edge indices are defined by $M$ . In application, a function sparse2vec: $\mathbb{R}^{n\times n}\to \mathbb{R}^m$ converts the sparse matrix to a vector by just keeping the components on valid indices of the mask. Algorithm 2 shows the forward calculation of the model for just one graph. To make the representation as simple as possible, we prefer to use tensor representation in Eq.(5). However, implementation of Algorithm 2 just apply $mlp_k(.)$ to the valid indices defined by receptive field mask $M$ . Thus, $C,C^{\prime}$ have the dimension of $\mathbb{R}^{m\times S}$ , where $m$ shows number of valid indices in $M$ and $mlp_k(.)$ applies on columns of $C^\prime$ . Beside, we use a function vec2sparse: $\mathbb{R}^m\rightarrow \mathbb{R}^{n\times n}$ that converts the vector to the sparse convolution support according to a given mask $M$ . + +The limit of the proposed method is similar to the limit of 3-WL (or 2-FWL) test. For instance, it fails to distinguish strongly regular graphs, that can be defined by 3 parameters: the degree of the nodes, the number of common neighbours of adjacent node pairs, and the number of common neighbours of non-adjacent node pairs. Such graphs are provably known to be 3-WL equivalent (Arvind et al., 2020). In Appendix E, a strongly regular graph's pair and the result of a sample sentence in $\mathcal{L}_3$ are presented. + +# 6. Experimental Results + +This section presents the experimental results obtained by the proposed models GNNML1 and GNNML3. All codes and datasets are available online $^{1}$ . We use GCN, GAT, GIN and Chebnet as 1-WL MPNN baselines and PPGN as 3-WL baseline (see Appendix H). Experiments aim to answer four questions: + +Q1: How many pairs of non-isomorphic simple graphs that are either 1-WL or 3-WL equivalent are not distinguished by the models? +Q2: Can the models generalize the counting of some substructures in a given graph? +Q3: Can the models learn low-pass, high-pass and bandpass filtering effects and generalize the classification problem according to the frequency of the signal? +Q4: Can the models generalize downstream graph classification and regression tasks? + +In order to perform experimental expressive power tests, we use graph8c and sr25 datasets2. Graph8c is composed of all the 11 117 possible connected non-isomorphic simple graphs with 8 nodes. We compare all possible pairs of graphs of this dataset, leading to more than 61M comparisons. According to our test, we found that 312 pairs out of 61M are 1-WL equivalent and none of the pairs are 3-WL equivalent. The sr25 dataset contains strongly regular graphs where each graph has 25 nodes, each node's degree is 12, connected nodes share 5 common neighbours and non-connected nodes share 6 common neighbors. Sr25 consists of 15 graphs, leading to 105 different pairs for comparison. + +Moreover, we use the EXP dataset (Abboud et al., 2020), having 600 pairs of 1-WL equivalent graphs. This dataset also includes a binary classification task. Depending on graph features, each graph of a pair of 1-WL equivalent graphs is assigned to two different classes. We split the dataset into 400, 100, and 100 pairs for train, validation and test sets respectively. The test set is used to measure the generalization ability: a model that fails to distinguish 1-WL equivalent graphs inevitably fails to learn this task. + +We use 3-layer graph convolution followed by sum readout layer, and then a linear layer to convert the readout layer representation into a 10-length feature vector. We keep the parameter budget around 30K for all methods. For graph8c, sr25 and EXP tasks, there is no learning. Model weights are randomly initialized and 10-length graph representations are compared by the Manhattan distance. If the distance is less than $10^{-3}$ in all 100 independent runs, we assume the pairs are similar. For EXP-classification task, we train the model and pick the best one according to validation set performance and report its performance on test set. + +Table 1. Number of undistinguished pairs of graphs in graph8c, sr25 and EXP datasets and binary classification accuracy on EXP dataset. An ideal method does not find any pair similar and classifies graphs with $100\%$ accuracy. The number of pairs is 61M for graph8c, 105 pairs for sr25 and 600 for EXP. + +
MODELGRAPH8CSR25EXPEXP-CLASSIFY
MLP293K10560050%
GCN477510560050%
GAT182810560050%
GIN38610560050%
CHEBNET441057182%
PPGN01050100%
GNNML133310560050%
GNNML301050100%
+ +Table 1 presents the obtained results. One can see that $99.5\%$ of the graphs in graph8c dataset can be distinguished even by graph agnostic method MLP (293K out of 61M is not separable by MLP). This can be explained by the fact that the node degrees has been added as node features. Hence, all methods initially know the result of first iteration of 1-WL test. Thus, MLP (and also first iteration of 1-WL test) can distinguish pairs of graphs when multiset of node degrees are not same. GNNML1 and GIN's result is very closed to the theoretical limit of 1-WL test which is 312 pairs for graph8c dataset. The difference can be explained by threshold value to make decision if the two representations are equal and/or the number of layers in the model. It is possible that 1-WL test may need more than 3 iteration to distinguish some pairs. Due to having less expressive power of GCN and GAT compare to the 1-WL test, their performances are worse than 1-WL test. Since graph8c dataset has 1-WL equivalent non-regular graph pairs that have different maximum eigenvalue, Chebnet could detect these pairs and reaches better performance than theoretical limit of 1-WL test as stated by Theorem 2. + +On EXP dataset, composed of 1-WL equivalent graph pairs, MPNNs cannot distinguish any pair of graphs, except Chebnet which is able to distinguish all the pairs with different maximum eigenvalues. In EXP there is no regular graphs and only 71 graph pairs have similar maximum eigenvalues. Chebnet fails on these pairs but distinguishes the others, as stated by Theorem 2. One can note that using a fixed value for maximum eigenvalue (e.g. $\lambda_{max} = 2$ as it is usually done in practice) reduces Chebnet performance to those of MPNNs. + +Similarly to results on EXP, 1-WL equivalent MPNNs except Chebnet fail to predict of EXP classification task and do not perform better than random prediction. On the contrary, PPGN and GNNML3 have perfect results on graph8c, EXP and EXP-classify tasks thanks to their 3-WL equivalence. However, since strongly regular graphs are 3-WL equivalent, no model less or as powerful as 3-WL test can distinguish the pairs in sr25 dataset. To obtain a better result on this + +Table 2. Median of test set MSE error for graphlet counting problem on random graph dataset over 10 random runs. + +
MODEL3-STARSCUSTOMTRIANGLETAILED-TRI4-CYCLES
MLP1.0E-44.58E-13.13E-12.22E-11.73E-1
GCN1.0E-43.22E-32.43E-11.42E-11.14E-1
GAT1.0E-44.57E-32.47E-11.44E-11.12E-1
GIN1.0E-41.47E-32.06E-11.18E-11.21E-1
CHEBNET1.0E-47.68E-42.01E-11.15E-19.60E-2
PPGN1.0E-49.19E-41.00E-42.61E-43.30E-4
GNNML11.0E-42.75E-42.45E-11.32E-11.14E-1
GNNML31.0E-47.24E-44.44E-43.18E-46.62E-4
+ +dataset, we need to go further than 3-WL (see Appendix E). These experiments reply to Q1. + +To bring an answer to Q2, we propose to count 3-star, triangle, tailed-triangle and 4-cycle substructures (Fig. 2). In addition to these 4 graphlets, we also create another task (noted as CUSTOM in Table 2) that aims to approximate a custom sentence $e_c \in \mathcal{L}_1^+$ , $e_c(A) = \mathbf{1}^\top A \, diag(exp(-A^2\mathbf{1}))A\mathbf{1}$ with $A$ the graph adjacency matrix. Since $e_c \in ML(\mathcal{L}_1^+)$ , it may be learnable by 1-WL equivalent MPNNs. We used the RandomGraph dataset (Chen et al., 2020) with same partitioning: 1500, 1000 and 2500 graphs for train, validation and test respectively. To create the ground truth of number of graphlets, we count them according to theorem proofs in Appendix B.3, B.4, B.5 and normalized the number to a unitary standard deviations, to keep the errors in the same scale as in Table 2. We use 4 convolution layers, a graph readout layer computing a sum and followed by 2 fully connected layers. All methods parameter budget is around 30K. We keep the maximum number of iterations to 200 and we stop the algorithm if the error goes below $10^{-4}$ . + +The results in Table 2 are consistent with Theorems 3, 4, 5. 3-WL models are able to count graphlets and approximate our custom function (result $< 10^{-3}$ ), while 1-WL equivalent models can only count the 3-stars graphlet, as stated in Theorem 3. Custom function approximation results also show that GNNML1 and Chebnet provide better approximation of the target other MPNNs, which is again consistent with our analysis. + +Question Q3 concerns the spectral expressive power of models. Such an analysis is important when input-output relations depend on the spectral properties of the graph signal such as in image/signal processing applications. As shown in (Balcilar et al., 2021), the vast majority of existing MPNNs operate as low-pass filters which limits their capacity. To lead this analysis, we use the datasets presented in (Balcilar et al., 2021). First, we evaluate if the models can learn low-pass, high-pass and band-pass filtering effects, through a node regression problem. Model performances are thus reported $R^2$ using mean square error (MSE) loss. The original data consists in a 2-d grid graph of size 100x100. + +Table 3. Spectral expressive analysis results. $R^2$ for LowPass, HighPass and BandPass node regression tasks, accuracy on graph classification task. Results are median of 10 different runs. + +
MODELLOW-PASSHIGH-PASSBAND-PASSCLASSIFY
MLP0.97490.01670.002750.0%
GCN0.98580.08630.005177.9%
GAT0.98110.08790.004485.3%
GIN0.98240.29340.062987.6%
CHEBNET0.99950.99010.821798.2%
PPGN0.99910.99250.104191.2%
GNNML10.99940.98330.380292.8%
GNNML30.99950.99090.818997.8%
+ +Since the PPGN's memory and computational complexity is prohibitive with a reasonable computer, we select 3 different $30 \times 30$ regions of the original 2-d grid graph as training, validation and test sets. A second dataset consists of 5K planar graphs, split into 3K, 1K and 1K sets for train, validation and test. They are used to evaluate if the models can classify graphs into binary classes where the ground truth labels were determined according to the frequency of the signal on the graph. Since the problem is binary graph classification we use binary cross entropy loss. + +The results of spectral expressive power analysis are presented in Table 3. Node regression results show that 1-WL equivalent existing MPNNs can mostly learn low-pass effects. By applying different weights to self node and neighbourhood, GNNML1 can learn high pass effect relatively well. PPGN also learns high-pass effect better than 1-WL equivalent methods. Band-pass can be generalized by Chebnet and GNNML3 thanks to the convolutions designed in spectral domain. The reason why the band-pass regression results are worse than the low and high-pass results is that the ground truth band-pass effect is created by very stiff frequency function and Chebnet also GNNML3 need more convolution supports to learn it. Because of non-local process in PPGN, it cannot learn the band-pass effect and provide no better result than 1-WL MPNNs in graph classification problem. Thus, Chebnet and GNNML3 give the best results on all spectral ability test, thanks to their spectral convolutions process. + +For answering the last question Q4, we apply the different models on some common benchmark tasks and datasets. Table 4 and Table 5 present the performance of both baseline models and the proposed ones on these benchmark datasets. The results on Zinc12K and MNIST-75 datasets are very interesting because of the nature of these two problems. The solution of the Zinc12K dataset mostly depends on structural features of the graph. For instance, a recent study reaches 0.14 MAE by using handcrafted features, which cannot be extracted by a 3-WL equivalent model (Bouritsas et al., 2020). Obtained results confirm that models that are able to count substructures, such as PPGN and GNNML3, + +Table 4. Results on Zinc12K and MNIST-75 datasets. The values are the MSE for Zinc12K and the accuracy for MNIST-75. Edge features are not used even if they are available in the datasets. For Zinc12K, all models use node labels. For MNIST-75, the model uses superpixel intensive values and node degree as node features + +
MODELZ1NC12KMNIST-75
MLP0.5869 ± 0.02525.10% ± 0.12
GCN0.3322 ± 0.01052.80% ± 0.31
GAT0.3977 ± 0.00782.73% ± 0.21
GIN0.3044 ± 0.01075.23% ± 0.41
CHEBNET0.3569 ± 0.01292.08% ± 0.22
PPGN0.1589 ± 0.00790.04% ± 0.54
GNNML10.3140 ± 0.01584.21% ± 1.75
GNNML30.1612 ± 0.00691.98% ± 0.18
+ +perform better than others with a large margin. On the other hand, since MNIST-75 dataset is based on image analysis, it needs a model with a higher spectral ability. Therefore, Chebnet and GNNML3 perform significantly better than other models on this task. Our proposal GNNML3 gives comparable results on other TU datasets in (Morris et al., 2020) such as MUTAG, ENZYMES, PROTEINS and PTC presented in Appendix F. + +# 7. Conclusion + +Despite a computational and memory efficiency, MPNN is known to have an expressive power limited to 1-WL test. MPNN is then unable to distinguish 1-WL equivalent graphs and cannot count some substructures of the graph. In this paper, we have presented new models, by translating the insights of MATLAB to the GNN world. This solution gives access to a new MPNN that is theoretically more powerful than the 1-WL test, and experimentally as powerful as 3-WL existing models for distinguishing non-isomorphic graphs and for counting substructures without feature engineering nor node permutations in the training phase. The proposed MPNN is also powerful in terms of spectral expressive ability, going beyond low-pass filtering, which is another expressive perspective of GNNs. Experimental results confirm the theorems stated in the paper. The proposed method has a big advantage over all studied MPNN on graph isomorphism and substructure counting tasks. With respect to the 3-WL equivalent baseline PPGN, the biggest advantage of our proposal is its complexity. Proposed GNNML3 needs linear memory and time complexity with respect to the number of nodes, while PPGN needs quadratic memory and cubic time complexity, making the model infeasible for large graphs. The second advantage over PPGN is that since it is created in the spectral domain, its convolution process takes care of signal frequencies, making it more efficient in terms of output signal frequency profile. + +# Acknowledgments + +This work was partially supported by the Normandy Region (grant RiderNet), the French Agence National de Recherche (grant API, ANR-18-CE23-0014) and the PAUSE Program of Collège de France. + +# References + +Abboud, R., Ceylan, I. I., Grohe, M., and Lukasiewicz, T. The surprising power of graph neural networks with random node initialization. arXiv preprint arXiv:2010.01179, 2020. +Arvind, V., Fuhlbrück, F., Köbler, J., and Verbitsky, O. On weisfeiler-leman invariance: subgraph counts and related graph properties. Journal of Computer and System Sciences, 2020. +Balcilar, M., Renton, G., Héroux, P., Gaüzère, B., Adam, S., and Honeine, P. Analyzing the expressive power of graph neural networks in a spectral perspective. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=-qh0M9XWxnv. +Barceló, P., Kostylev, E. V., Monet, M., Pérez, J., Reutter, J., and Silva, J. P. The logical expressiveness of graph neural networks. In International Conference on Learning Representations, 2019. +Battaglia, P. W., Hamrick, J. B., Bapat, V., Sanchez-Gonzalez, A., Zambaldi, V., Malinowski, M., Tacchetti, A., Raposo, D., Santoro, A., Faulkner, R., et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018. +Bouritsas, G., Frasca, F., Zafeiriou, S., and Bronstein, M. M. Improving graph neural network expressivity via subgraph isomorphism counting. arXiv preprint arXiv:2006.09252, 2020. +Bresson, X. and Laurent, T. Residual gated graph convnets, 2018. URL https://openreview.net/forum? id=HyXbCYg0b. +Brijder, R., Geerts, F., Bussche, J. V. D., and Weerwag, T. On the expressive power of query languages for matrices. ACM Transactions on Database Systems (TODS), 44(4): 1-31, 2019. +Chami, I., Abu-El-Haija, S., Perozzi, B., Ré, C., and Murphy, K. Machine learning on graphs: A model and comprehensive taxonomy. arXiv preprint arXiv:2005.03675, 2020. +Chen, Z., Chen, L., Villar, S., and Bruna, J. Can graph neural networks count substructures? arXiv preprint arXiv:2002.04025, 2020. + +Chung, F. Spectral graph theory. American Mathematical Society, 1997. +Dasoulas, G., Dos Santos, L., Scaman, K., and Virmaux, A. Coloring graph neural networks for node disambiguation. In Bessiere, C. (ed.), Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pp. 2126-2132, 7 2020. doi: 10.24963/ijcai.2020/294. URL https://doi.org/10.24963/ijcai.2020/294. +Defferrard, M., Bresson, X., and Vandergheynst, P. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3844-3852, 2016. +Dehmamy, N., Barabási, A.-L., and Yu, R. Understanding the representation power of graph neural networks in learning graph topology. In NeurIPS, pp. 15387-15397, 2019. +Dwivedi, V. P., Joshi, C. K., Laurent, T., Bengio, Y., and Bresson, X. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020. +Fey, M. and Lenssen, J. E. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019. +Geerts, F. On the expressive power of linear algebra on graphs. Theory of Computing Systems, Oct 2020. ISSN 1433-0490. doi: 10.1007/s00224-020-09990-9. URL https://doi.org/10.1007/s00224-020-09990-9. +Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyal, O., and Dahl, G. E. Neural message passing from quantum chemistry. In Proceedings of the International Conference on Machine Learning, 2017. +Hamilton, W., Ying, Z., and Leskovec, J. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024-1034, 2017. +Hammond, D. K., Vandergheynst, P., and Gribonval, R. Wavelets on graphs via spectral graph theory. Applied and Computational Harmonic Analysis, 30(2):129-150, 2011. +Harary, F. and Manvel, B. On the number of cycles in a graph. Matematicky chasopis, 21(1):55-63, 1971. +Hornik, K., Stinchcombe, M., and White, H. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359-366, 1989. +Immerman, N. and Lander, E. Describing graphs: A first-order approach to graph canonization. In Complexity theory retrospective, pp. 59-81. Springer, 1990. + +Keriven, N. and Peyre, G. Universal invariant and equivariant graph neural networks. In Advances in Neural Information Processing Systems 32, pp. 7092-7101. 2019. +Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017. +Maron, H., Ben-Hamu, H., Serviansky, H., and Lipman, Y. Provably powerful graph networks. In Advances in Neural Information Processing Systems, pp. 2156-2167, 2019a. +Maron, H., Fetaya, E., Segol, N., and Lipman, Y. On the universality of invariant networks. 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. 4363-4371, Long Beach, California, USA, 09-15 Jun 2019b. PMLR. +Morris, C., Ritzert, M., Fey, M., Hamilton, W. L., Lenssen, J. E., Rattan, G., and Grohe, M. Weisfeiler and leman go neural: Higher-order graph neural networks. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01): 4602-4609, Jul. 2019. +Morris, C., Kriege, N. M., Bause, F., Kersting, K., Mutzel, P., and Neumann, M. Tudataset: A collection of benchmark datasets for learning with graphs. arXiv preprint arXiv:2007.08663, 2020. +Murphy, R., Srinivasan, B., Rao, V., and Ribeiro, B. Relational pooling for graph representations. 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. 4663-4673, Long Beach, California, USA, 09-15 Jun 2019. PMLR. +Pinar, A., Seshadhri, C., and Vishal, V. Escape: Efficiently counting all 5-vertex subgraphs. pp. 1431-1440, 2017. +Sato, R., Yamada, M., and Kashima, H. Approximation ratios of graph neural networks for combinatorial problems. In Advances in Neural Information Processing Systems, volume 32, pp. 4081-4090. Curran Associates, Inc., 2019. +Sato, R., Yamada, M., and Kashima, H. Random features strengthen graph neural networks. arXiv preprint arXiv:2002.03155, 2020. +Shuman, D. I., Narang, S. K., Frossard, P., Ortega, A., and Vandergheynst, P. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE signal processing magazine, 30(3):83-98, 2013. + +Takapoui, R. and Boyd, S. Linear programming heuristics for the graph isomorphism problem. arXiv preprint arXiv:1611.00711, 2016. +Van Dam, E. R. and Haemers, W. H. Which graphs are determined by their spectrum? Linear Algebra and its applications, 373:241-272, 2003. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017. +Veličković, P., Cucurull, G., Casanova, A., Romero, A., Lio, P., and Bengio, Y. Graph attention networks. In International Conference on Learning Representations (ICLR), 2018. +Vignac, C., Loukas, A., and Frossard, P. Building powerful and equivariant graph neural networks with structural message-passing. In NeurIPS, 2020. +Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., and Yu, P. S. A comprehensive survey on graph neural networks. arXiv preprint arXiv:1901.00596, 2019. +Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. \ No newline at end of file diff --git a/breakingthelimitsofmessagepassinggraphneuralnetworks/images.zip b/breakingthelimitsofmessagepassinggraphneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d6502e0c9cf909fd8451ecaf49814549ca2d8f0d --- /dev/null +++ b/breakingthelimitsofmessagepassinggraphneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3332487b25d651675f9166cc616ea0e22389aa4d340042c62d3670552ca634ec +size 166289 diff --git a/breakingthelimitsofmessagepassinggraphneuralnetworks/layout.json b/breakingthelimitsofmessagepassinggraphneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..bd626150a3610dfaa48812604979e174a1edb14e --- /dev/null +++ b/breakingthelimitsofmessagepassinggraphneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:487fd80694212164e396dbab8197469feb6e4ae386f1c5f23455c4c420e109af +size 462051 diff --git a/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_content_list.json b/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..86b7783f5a9498e4804625dee5462e3f2c29156e --- /dev/null +++ b/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8aa5789e13eca7fac6570fca47c58b8e7abed9586f2e570c2dbd4ee05b0d8bb9 +size 96954 diff --git a/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_model.json b/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bb673a7edcb12154bace6d17d19db244fa6d9d01 --- /dev/null +++ b/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f29b3236fb732c98c885f817b003104050a713bfdb3a8e1ce6127e3b8c6c7d2 +size 120819 diff --git a/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_origin.pdf b/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7c051262edbc838374966bd70d4097c5d579f785 --- /dev/null +++ b/breakitfixitunsupervisedlearningforprogramrepair/b00dc6da-6c3e-4951-96a4-00773dc59fec_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bf9dde395f008330eb8ab5856b272822bdd0251e82a3bd48b8b2fb5da3668aa +size 1062460 diff --git a/breakitfixitunsupervisedlearningforprogramrepair/full.md b/breakitfixitunsupervisedlearningforprogramrepair/full.md new file mode 100644 index 0000000000000000000000000000000000000000..99dd2247c79d3630360005aec81266398dd910a3 --- /dev/null +++ b/breakitfixitunsupervisedlearningforprogramrepair/full.md @@ -0,0 +1,403 @@ +# Break-It-Fix-It: Unsupervised Learning for Program Repair + +Michihiro Yasunaga1 Percy Liang1 + +# Abstract + +We consider repair tasks: given a critic (e.g., compiler) that assesses the quality of an input, the goal is to train a fixer that converts a bad example (e.g., code with syntax errors) into a good one (e.g., code with no syntax errors). Existing works create training data consisting of (bad, good) pairs by corrupting good examples using heuristics (e.g., dropping tokens). However, fixers trained on this synthetically-generated data do not extrapolate well to the real distribution of bad inputs. To bridge this gap, we propose a new training approach, Break-It-Fix-It (BIFI), which has two key ideas: (i) we use the critic to check a fixer's output on real bad inputs and add good (fixed) outputs to the training data, and (ii) we train a breaker to generate realistic bad code from good code. Based on these ideas, we iteratively update the breaker and the fixer while using them in conjunction to generate more paired data. We evaluate BIFI on two code repair datasets: GitHub-Python, a new dataset we introduce where the goal is to repair Python code with AST parse errors; and DeepFix, where the goal is to repair C code with compiler errors. BIFI outperforms state-of-the-art methods, obtaining $90.5\%$ repair accuracy on GitHub-Python $(+28.5\%)$ and $71.7\%$ on DeepFix $(+5.6\%)$ . Notably, BIFI does not require any labeled data; we hope it will be a strong starting point for unsupervised learning of various repair tasks. + +# 1. Introduction + +In many domains, one has access to a *critic* that assesses the quality of an input, but what is desired is a more constructive *fixer* that actually improves bad inputs. For instance, in programming, while a code analyzer and compiler can tell if a given code has errors, programmers need to repair the errors in the bad code. Development of an automatic code fixer is thus a key to enhancing programming productivity (Seo et al., 2014) and is an active area of research (Mesbah et al., 2019; Ding et al., 2020; Dinella et al., 2020). Other + +1Stanford University, Stanford, CA. Correspondence to: Michihiro Yasunaga . + +Proceedings of the $38^{th}$ International Conference on Machine Learning, PMLR 139, 2021. Copyright 2021 by the author(s). + +![](images/f77434da43a21f5331f06a47b49d40791e7f850179e349134c914eebe626940a.jpg) +Figure 1. Problem setup. We are given an unlabeled data (code snippets) and a critic (e.g., code analyzer, compiler) that assesses the quality of an input (e.g., bad if the code has errors; good if no error). Our task is to learn a fixer that can actually repair a bad example into a good one (e.g., fixing errors in the bad code). + +instances of this general setting include molecular design (Jin et al., 2019) which aims to improve the chemical properties (e.g., drug-likeness) of molecules given a property evaluator, and essay editing (Taghipour & Ng, 2016) which aims to improve a writing given a grade. How to automatically learn a fixer given a critic (we term *critic2fixer* remains an important research problem in machine learning. + +In this work, we focus on the domain of code repair. Learning a fixer is challenging because manual labeling of paired data, e.g., $\langle$ broken code, fixed code $\rangle$ , is costly. To this end, we consider learning from unlabeled data. Specifically, as illustrated in Figure 1, we are given (a) a critic (code analyzer or compiler) that assesses the quality of an input (bad if the code has errors; good if there are no errors), and (b) unlabeled data (unpaired good code and bad code, e.g., collected on GitHub); our goal is to learn a fixer that repairs bad code into good code. Previous works in code repair apply random or heuristic perturbations to good code (e.g., dropping tokens) and prepare synthetic paired data $\langle$ perturbed code, good code $\rangle$ to train a fixer (Pu et al., 2016; Gupta et al., 2017; Ahmed et al., 2018; Hajipour et al., 2019; Yasunaga & Liang, 2020). However, such synthetically generated bad examples do not match the + +![](images/fa5541cb12ad57d446f33a8f93ffa7bf17f4dd49be2e674e4f3767f9f2a31d9a.jpg) +Figure 2. Challenge of learning a fixer from unlabeled data. Existing works randomly perturb good examples into bad examples and learn to recover. However, such synthetically generated bad examples do not match the distribution of real bad examples. For instance, synthetic perturbations may drop parentheses arbitrarily from code (top right), but real human-written bad code misses parentheses more often in a nested context (top center). In a more extreme case at bottom, to generate the human error (center) from the corrected code (left), a pair of indent and deduct tokens need to be inserted accordingly, which random perturbations generate with very small probability. Note that indentation is meaningful in Python: in the tokenized Python code, each $\langle \mathbf{I} \rangle$ token means indenting the line by one unit, each $\langle \mathbf{D} \rangle$ means deducting the next line by one unit. + +distribution of real bad examples. For instance, as shown in Figure 2, synthetic perturbations may drop parentheses arbitrarily from code, generating errors that rarely happen in real programming (Figure 2 top right; synthetic errors); in contrast, real human-written code misses parentheses more often in a nested context (Figure 2 top center; human errors). As we will show in §4, this distribution mismatch between synthetic data and real data results in low performance. + +To bridge this gap, we propose Break-It-Fix-It (BIFI), a new method to learn a fixer from unlabeled data and a critic (Figure 3). BIFI is based on two core insights: (i) we can use the critic to check a fixer's output on real bad examples and add good outputs to the training data, and (ii) we train a breaker to generate realistic bad examples from good examples. Specifically, given an initial fixer trained on synthetic paired data (synthetic bad, good), BIFI improves the fixer and breaker simultaneously through rounds of data generation and training: (1) apply the fixer to real bad examples and keep fixed outputs to obtain real paired data, (2) use the resulting data to train the breaker, (3) use the learned breaker to generate code errors and obtain more paired data, and (4) train the fixer on the newly-generated paired data in (1) and (3). Intuitively, this cycle trains the fixer on increasingly more real or realistically generated bad code, adapting the fixer from the initial synthetic distributions towards real distributions of code errors. + +The BIFI algorithm is related to backtranslation in unsupervised machine translation (Lample et al., 2018a), which uses a target-to-source model to generate noisy sources and trains + +a source-to-target model to reconstruct the targets (e.g., the bad-side and good-side in our repair task can be viewed as the source and target). BIFI differs from backtranslation in two ways: it uses the critic to verify if the generated examples are actually fixed or broken (step 1 and 3), and it trains the fixer on real bad examples in addition to examples generated by the breaker (step 4), which improves the correctness and distributional match of generated paired data. + +We evaluate our proposed approach on two datasets: + +- GitHub-Python: We collected a new dataset of 3M Python code snippets from github.com. The task is to repair errors caught by the Python AST parser. We set the initial fixer to be an encoder-decoder Transformer (Vaswani et al., 2017) trained on random perturbations. +- **DeepFix** (Gupta et al., 2017): The task is to repair compiler errors in C code submitted by students in an introductory programming course. We set the initial fixer to be the existing best system, DrRepair (Yasunaga & Liang, 2020), which was trained on manually-designed heuristic perturbations. + +Our approach (BIFI) outperforms the initial fixers, obtaining $90.5\%$ repair accuracy on GitHub-Python $(+28.5\%$ absolute) and $71.7\%$ repair accuracy on DeepFix $(+5.6\%$ absolute), attaining a new state-of-the-art. BIFI also improves on backtranslation by $10\%$ . Further, we qualitatively show how the fixer and breaker adapt towards more realistic distributions of code through the BIFI algorithm ( $\S 4.3$ ). + +# 2. Problem statement + +Figure 1 illustrates our problem setup, critic2fixer. The system is given unlabeled data $\mathcal{D}$ (code snippets) and a critic $c$ (code analyzer or compiler) that returns whether an input is good or bad: e.g., for a code snippet $x \in \mathcal{D}$ , + +$$ +c (x) = \left\{ \begin{array}{l l} 0 & \text {i f} x \text {h a s e r r o r s ,} \\ 1 & \text {i f} x \text {h a s n o e r r o r .} \end{array} \right. \tag {1} +$$ + +Using the critic $c$ , examples in $\mathcal{D}$ can be classified into bad ones $\mathcal{D}_{\mathrm{bad}} = \{x \mid x \in \mathcal{D}, c(x) = 0\}$ and good ones $\mathcal{D}_{\mathrm{good}} = \{y \mid y \in \mathcal{D}, c(y) = 1\}$ . Our task is to learn a fixer $f$ that maps a bad example $x \in \mathcal{D}_{\mathrm{bad}}$ into a good example $f(x)$ such that it is close to $x$ and $c(f(x)) = 1$ . The evaluation metric is the fixer $f$ 's repair accuracy on a held-out set of bad examples, $\mathcal{D}_{\mathrm{bad}}^{\mathrm{(test)}}$ , + +$$ +\operatorname {R e p a i r A c c} = \frac {\left| \left\{x \mid x \in \mathcal {D} _ {\text {b a d}} ^ {\text {(t e s t)}} , c (f (x)) = 1 \right\} \right|}{\left| \mathcal {D} _ {\text {b a d}} ^ {\text {(t e s t)}} \right|}. \tag {2} +$$ + +# 3. Approach + +The major challenge of learning a fixer is that we need to learn from unpaired data, i.e., $\mathcal{D}_{\mathrm{bad}}$ and $\mathcal{D}_{\mathrm{good}}$ do not form $\langle$ broken, fixed $\rangle$ pairs. Prior works in code repair apply random or + +# §3.1 Initialization — Round 0 + +![](images/77290a75b4cf1907275d953f3ef3517fb48950addb7bfb17e76dfb2cf30289cc.jpg) + +# §3.3 ref. Backtranslation — Round $k (=1,2,\ldots)$ + +![](images/8d5e45f4f87c3999cff9600e7c577dc920be977a3b402b68edaabcd20d1851b9.jpg) + +![](images/59ae310c4016cd8b008e021b9c694fe65fbec3ec801989cea813de87390ac2a8.jpg) + +# §3.4 FixerOnly — Round $k (= 1,2,\ldots)$ + +![](images/4489bced661b3141e4452b219b4dd7a3c7dc4006e972dd5576cf41b30d16e6c2.jpg) + +# §3.2 Break-It-Fix-It (BIFI) — Round $k (=1,2,\ldots)$ + +![](images/4d1f8c09b44bdda7a3d8431244610a031714ba963951b36755dd4d93f41f6dbe.jpg) + +![](images/9a18b863ab1865dca5acee40b11c6be433efd2c4618e7f870b5906c9e9d9aa20.jpg) +Figure 3. Overview of our approach. We train the initial fixer on synthetically prepared data as in prior works (top left). In our approach, BIFI (bottom right), we apply the initial fixer to the real bad examples and add fixed outputs (verified by the critic) to our training data (Step 1), train a breaker on the resulting paired data (Step 2), use the breaker to generate (intuitively more realistic) code errors (Step 3), and train the fixer again on the newly-generated paired data (Step 4). We iterate this cycle, improving the fixer and the breaker simultaneously. Top right: a version of BIFI without the breaker (FixerOnly). Bottom left: comparison of BIFI to backtranslation. The main difference is that BIFI uses the critic to verify that the fixer produces good code and the breaker produces bad code (annotated with magenta font). + +heuristic perturbations to good examples (e.g., dropping tokens) and prepare a synthetic paired data (perturbed code, good code) to train a fixer (Gupta et al., 2017; Ahmed et al., 2018; Yasunaga & Liang, 2020). However, such synthetically generated bad examples do not match the distribution of real bad examples. For instance, as Figure 2 (top) shows, synthetic perturbations may drop parentheses arbitrarily from code, generating errors that are rare in real programs; in contrast, real human-written code misses parentheses often in a nested context (e.g., 10x more than non-nested in our collected dataset GitHub-Python). In a more extreme case (Figure 2 bottom), to make the real human error (center) from the corrected code (left), multiple tokens (in this case, a pair of indent and dedent) need to be inserted or dropped accordingly, which random perturbations would generate with extremely low probability. This distribution mismatch between synthetic data and real data results in low performance ( $\S 4$ ). + +To address this challenge, we propose Break-It-Fix-It (BIFI), an approach that adapts the fixer automatically towards real distributions of bad examples. Concretely, we first start from the synthetic paired data $\langle$ synthetic bad, good $\rangle$ and train an initial fixer as in prior works (see Figure 3 top left; initialization). We then perform the following cycle (see Figure 3 bottom right): (1) we apply the initial fixer to the real bad examples and use the critic to assess if the fixer's output is good—if good, we keep the pair; (2) we train a breaker on the resulting paired data—as this data consists of real code errors, + +intuitively, the breaker learns to generate realistic code errors; (3) we apply the breaker to the good examples; (4) we finally train the fixer on the newly-generated paired data in (1) and (3). We iterate this cycle to improve the fixer and the breaker simultaneously in the process. The intuition is that a better fixer and breaker will be able to generate more realistic paired data, which in turn helps to train a better fixer and breaker. + +Below, we describe the initialization step in §3.1, our main algorithm BIFI in §3.2, and discuss two baselines of BIFI: backtranslation (§3.3) and FixerOnly (version of BIFI without the breaker; §3.4). + +# 3.1. Initialization + +Given unlabeled data $\mathcal{D} = (\mathcal{D}_{\mathrm{bad}},\mathcal{D}_{\mathrm{good}})$ , we first prepare a synthetic paired data $\mathcal{P}_{\mathrm{synthetic}}$ by perturbing good examples: + +$$ +\mathcal {P} _ {\text {s y n t h e t i c}} = \left\{\left(b _ {\text {s y n t h e t i c}} (y), y\right) \mid y \in \mathcal {D} _ {\text {g o o d}} \right\}, \tag {3} +$$ + +where $b_{\mathrm{synthetic}}$ denotes a pre-defined procedure that corrupts code. For instance, we will experiment with two choices of $b_{\mathrm{synthetic}}$ : (i) random noising, which randomly drops/inserts /replaces tokens in code, and (ii) heuristic noising designed in Yasunaga & Liang (2020), which aims to generate common programming errors such as typo, punctuation and type errors. More details are described in §4.1. + +We then train the initial fixer $f_{0}$ and breaker $b_{0}$ on the + +synthetic paired data: + +$$ +b _ {0} = \operatorname {T R A I N} ^ {\text {g o o d} \rightarrow \text {b a d}} \left(\mathcal {P} _ {\text {s y n t h e t i c}}\right) \tag {4} +$$ + +$$ +f _ {0} = \operatorname {T R A I N} ^ {\text {b a d} \rightarrow \text {g o o d}} \left(\mathcal {P} _ {\text {s y n t h e t i c}}\right) \tag {5} +$$ + +where $\mathrm{TRAIN}^{\mathrm{good}\rightarrow \mathrm{bad}}(\mathcal{P})$ denotes training an encoder-decoder model that maps good-side examples to bad-side examples in a paired data $\mathcal{P}$ , and $\mathrm{TRAIN}^{\mathrm{bad}\rightarrow \mathrm{good}}(\mathcal{P})$ does the reverse. Note that $f_{0}$ here corresponds to the fixer learned in prior works (e.g., Gupta et al. (2017); Yasunaga & Liang (2020)). We call this initialization step our round 0. + +# 3.2. Break-It-Fix-It (BIFI) + +BIFI aims to improve the fixer and breaker simultaneously through rounds of data generation and training: (1) use a fixer to create data for a breaker, (2) train a breaker, (3) use a breaker to create data for a fixer, and (4) train a fixer. Concretely, after the initialization step, BIFI performs the following in each round $k = 1,2,\dots,K$ : + +$$ +\mathcal {P} _ {k} ^ {(f)} = \left\{\left(x, f _ {k - 1} (x)\right) \mid x \in \mathcal {D} _ {\text {b a d}}, c \left(f _ {k - 1} (x)\right) = 1 \right\} \tag {6} +$$ + +$$ +b _ {k} = \operatorname {T R A I N} ^ {\text {g o o d} \rightarrow \text {b a d}} \left(\mathcal {P} _ {k} ^ {(f)}\right) \tag {7} +$$ + +$$ +\mathcal {P} _ {k} ^ {(b)} = \left\{\left(b _ {k} (y), y\right) \mid y \in \mathcal {D} _ {\text {g o o d}}, c \left(b _ {k} (y)\right) = 0 \right\} \tag {8} +$$ + +$$ +f _ {k} = \operatorname {T R A I N} ^ {\text {b a d} \rightarrow \text {g o o d}} \left(\mathcal {P} _ {k} ^ {(f)} \cup \mathcal {P} _ {k} ^ {(b)}\right). \tag {9} +$$ + +For convenience, we call the original examples in $\mathcal{D}_{\mathrm{bad}}$ real bad examples. Here Eq 6 applies the current fixer $f_{k-1}$ to the real bad examples in $\mathcal{D}_{\mathrm{bad}}$ , and keeps outputs that are actually fixed (verified by the critic $c$ ; red part). This way, we can obtain new paired data $\mathcal{P}_k^{(f)}$ that is based on real bad examples. Eq 7 then trains the breaker $b_k$ (fine-tunes from the previous breaker $b_{k-1}$ ) on this new paired data $\mathcal{P}_k^{(f)}$ so that intuitively it can learn to generate realistic bad examples. Next, Eq 8 applies the breaker $b_k$ to the good examples in $\mathcal{D}_{\mathrm{good}}$ , and keeps outputs that are actually broken (verified by the critic $c$ ; red part). This provides an extra paired data $\mathcal{P}_k^{(b)}$ that is based on bad examples generated by the learned breaker. Finally, Eq 9 trains the fixer $f_k$ (fine-tunes from the previous fixer $f_{k-1}$ ) on both $\mathcal{P}_k^{(f)}$ and $\mathcal{P}_k^{(b)}$ , so that the fixer sees real and breaker-generated bad examples. Over time, this cycle adapts the fixer and breaker towards the distribution of real examples. Figure 3 (bottom right) provides an illustration of BIFI. + +# 3.3. Comparison with Backtranslation + +The BIFI algorithm is related to backtranslation (Lample et al., 2018b) in unsupervised machine translation. One may view the bad-side and good-side in our setup as two source/target languages in machine translation. Backtranslation uses a target-to-source model to generate noisy sources and trains a source-to-target model to reconstruct the targets. Specifically, + +in each round $k$ , backtranslation performs the following: + +$$ +\mathcal {P} _ {k} ^ {(f)} = \left\{\left(x, f _ {k - 1} (x)\right) \mid x \in \mathcal {D} _ {\text {b a d}} \right\} \tag {10} +$$ + +$$ +b _ {k} = \operatorname {T R A I N} ^ {\text {g o o d} \rightarrow \text {b a d}} \left(\mathcal {P} _ {k} ^ {(f)}\right) \tag {11} +$$ + +$$ +\mathcal {P} _ {k} ^ {(b)} = \left\{ \right.\left( \right.b _ {k} (y), y) \mid y \in \mathcal {D} _ {\text {g o o d}} \left. \right\} \tag {12} +$$ + +$$ +f _ {k} = \operatorname {T R A I N} ^ {\text {b a d} \rightarrow \text {g o o d}} \left(\mathcal {P} _ {k} ^ {(b)}\right). \tag {13} +$$ + +BIFI differs in two aspects. First, as our task has a critic, BIFI uses the critic to verify the outputs of the fixer and breaker, and only keep examples whose outputs are actually fixed (Eq 6 red part) and whose outputs are broken (Eq 8 red part) to generate paired data. In contrast, backtranslation does not verify the generated paired data in Eq 10, 12. This may blindly include non-fixed code as good-side examples (consequently, the breaker might learn to output erroneous code) and non-broken code as bad-side examples, leading to noisy training data (e.g., Figure 3 bottom left). Secondly, while backtranslation trains the fixer only on examples predicted by the breaker (Eq 13), BIFI trains the fixer on the real bad examples $(\mathcal{P}_k^{(f)}$ in Eq 9) in addition to examples generated by the breaker, which improves the correctness and distributional match of training data. We will show in our ablation study ( $\S 4.3.3$ ) that both of these two components improve the learning of a fixer and breaker. Essentially, BIFI is an augmentation of backtranslation with a critic. + +# 3.4. Version of BIFI without breaker: FixerOnly + +The benefit of BIFI is to enable training the fixer on real bad examples and bad examples generated by a learned breaker. We consider a version (FixerOnly) that trains the fixer simply on the real bad examples (prepared in Eq 6) but not the bad examples generated by the breaker (Eq 8). Specifically, FixerOnly does the following in each round $k$ : + +$$ +\mathcal {P} _ {k} ^ {(f)} = \left\{\left(x, f _ {k - 1} (x)\right) \mid x \in \mathcal {D} _ {\text {b a d}}, c \left(f _ {k - 1} (x)\right) = 1 \right\} \tag {14} +$$ + +$$ +f _ {k} = \operatorname {T R A I N} ^ {\text {b a d} \rightarrow \text {g o o d}} \left(\mathcal {P} _ {k} ^ {(f)}\right). \tag {15} +$$ + +FixerOnly can also be viewed as self-training (Lee, 2013) with the difference that we only add fixer outputs verified by the critic to the training data. We will show in §4.3.1 that FixerOnly is especially useful when the amount of available bad examples $|\mathcal{D}_{\mathrm{bad}}|$ is big, but the gain is smaller compared to BIFI when $|\mathcal{D}_{\mathrm{bad}}|$ is small, because BIFI can use the breaker to generate additional paired data for training the fixer (Eq 8). + +# 4. Experiments + +We evaluate our approach on two code repair datasets: a common benchmark $\mathbf{DeepFix}^2$ (Gupta et al., 2017), and GitHub-Python, a bigger dataset we collect in this paper. + +# 4.1. Dataset and setup + +We first describe the detail and experimental setup for GitHub-Python and DeepFix. + +
MethodTest accuracy
TotalUnbalanced ParenthesesIndentation ErrorInvalid Syntax
InitialRound-062.0%87.7%39.4%70.5%
FixerOnlyRound-186.8%93.3%79.5%90.9%
Round-288.6%92.4%83.7%92.0%
BIFIRound-188.0%94.1%81.3%91.6%
Round-290.5%94.2%85.9%93.5%
+ +Table 1. Repair accuracy on the GitHub-Python test set. The initial fixer is trained on synthetic bad code. Our proposed method (BIFI) enables the fixer to be fine-tuned on real bad code and bad code generated by the learned breaker. The result shows that BIFI outperforms the initial fixer by a large margin. + +
MethodTest accuracy
DeepFix (Gupta et al., 2017)33.4%
RLAssist (Gupta et al., 2019)26.6%
SampleFix (Hajipour et al., 2019)45.3%
DrRepair (Yasunaga & Liang, 2020)66.1%
Our InitialRound-0 (=DrRepair)66.1%
Our FixerOnlyRound-168.6%
Round-270.5%
Our BIFIRound-170.8%
Round-271.7%
+ +Table 2. Repair accuracy on the DeepFix test set. We define our initial fixer (Round 0) to be the existing best system DrRepair. Note that DrRepair's training procedure coincides with the initialization step of our BIFI algorithm, with heuristic perturbations used in Eq 3. We then apply BIFI on top of it for Round 1, 2. BIFI outperforms DrRepair, achieving a new state-of-the-art. + +# 4.1.1. Github-Python + +Dataset. To obtain an unlabeled dataset of code, we collected Python3 files from GitHub public repositories. $^{3}$ We then tokenize each code file using the built-in Python tokenizer, and keep code snippets of length 10-128 tokens, resulting in 3M code snippets. As the critic $c$ , we use the Python AST parser, $^{4}$ which catches unbalanced parentheses, indentation errors, and other syntax errors. Concretely, we define $c(x) = 1$ (good) if the AST parser returns no errors for input code $x$ , and $c(x) = 0$ (bad) otherwise. Using this critic, we obtain 38K snippets of bad code and 3M snippets of good code. From the 38K bad examples, we holdout 15K as the final test set, and make the remaining 23K bad examples available for BIFI. Our goal is to learn a fixer that repairs AST parse errors. We define that the fixer's repair is successful if the output code has no AST parse errors and has Levenshtein edit-distance (Levenshtein, 1966) less than 5 tokens from the input code. The evaluation metric is the fixer's repair accuracy on the test set (the heldout 15K examples of real bad code). + +BIFI implementation details. For the architecture of the fixer and breaker, we use the encoder-decoder Transformer + +(Vaswani et al., 2017) with 4 layers, 8 attention heads, and hidden states of size 256. The model parameters are optimized by Adam (Kingma & Ba, 2015), with batch size of 20,000 tokens, learning rate 0.0001, and gradient clipping 1.0 (Pascanu et al., 2013), on one GPU (GTX Titan X). For generation, we use beam search with beam size 10, and keep predictions with Levenshtein edit-distance less than 5 tokens from the input. + +To train the initial fixer $f_{0}$ , we use random perturbations for the corruption procedure $b_{\mathrm{synthetic}}$ (Eq 3), which drops, inserts, or replaces 1-3 tokens in code with uniform distribution. We apply $b_{\mathrm{synthetic}}$ 8 times to each of the 2.6M good code snippets to prepare the initial training data $\mathcal{P}_{\mathrm{synthetic}}$ . We holdout 1% of $\mathcal{P}_{\mathrm{synthetic}}$ as our dev set, which we use to perform early stopping. We then run the BIFI algorithm for $K = 2$ rounds. + +# 4.1.2. DeepFix + +Dataset. DeepFix (Gupta et al., 2017) contains C code submitted by students in an introductory programming course, of which 37K snippets are good (no compiler error) and 7K are bad (have compiler errors). Each code snippet has 25 lines on average. Within the 7K bad examples, we take $20\%$ as a held-out test set. We make the remaining $80\%$ available for BIFI. The goal is to learn a fixer that repairs compiler errors. Repair is successful if the output code has no compiler errors. The evaluation metric is the fixer's repair accuracy on the test set. + +BIFI implementation details. We define the initial fixer $f_{0}$ as DrRepair (Yasunaga & Liang, 2020) (the existing best system on DeepFix), which is an encoder-decoder model trained in a procedure that corresponds exactly to the initialization step of BIFI (§3.1). Specifically, to train DrRepair, Yasunaga & Liang (2020) design heuristic perturbations for the corruption procedure $b_{\mathrm{synthetic}}$ , which mimics common code errors beginner and experienced programmers make (e.g., typos, punctuation, keyword and type errors). We use the same training/dev data prepared and released by the authors to train the initial fixer. We then run the BIFI algorithm for $K = 2$ rounds. Our fixer and breaker have the same model architecture as DrRepair. At test time, following the original DrRepair, we repeatedly apply the fixer while the code still has errors, up to a maximum of 5 times. + +# 4.2. Main results + +We study the fixer's repair accuracy on GitHub-Python and DeepFix. Here "round $k$ accuracy" means the repair accuracy of the fixer learned in round $k$ , i.e., $f_{k}$ . + +GitHub-Python. Table 1 shows the test results on GitHub-Python. We show the overall repair accuracy ("Total") as well as the breakdown over the error categories in the Python AST parser (table right). The initial fixer $f_{0}$ ("Initial") is trained on randomly perturbed, synthetic bad code. Our proposed method (BIFI) enables the initial fixer to be further trained on real bad code and bad code generated by the learned breaker, which outperforms the initial fixer significantly (+28.5% in overall repair accuracy, and consistently + +
MethodTest accuracy
Bad 100%Bad 50%Bad 10%ref. Synthetic bad only
InitialRound-062.0%62.0%62.0%62.0%
FixerOnlyRound-288.6%84.7%78.5%62.7%
BIFIRound-290.5%89.0%86.7%63.3%
+ +Table 3. Analysis varying the amount of (real) bad code on GitHub-Python. "Bad $100\%$ " is our original setting (with 23K real bad examples available for BIFI) and "Bad $50\%$ " means only $50\%$ of them (11.5K) are made available. "Synthetic bad only" means keeping training the fixer on synthetic bad examples. The result shows that (i) even when the amount of real bad examples is small (e.g., "Bad $10\%$ "), they are still useful, allowing FixerOnly/BIFI to perform better than using synthetic data alone; (ii) when the amount of real bad examples is small, BIFI exceeds FixerOnly by a larger margin, highlighting the usefulness of the bad examples generated by the learned breaker. + +
MethodTest accuracy
InitialRound-062.0%
BIFI (ours)Round-290.5%
– real badRound-284.6%
– criticRound-284.0%
– both (backtranslation)Round-280.1%
+ +across all error categories). This result suggests that even if we start from a very simple initial fixer trained with random perturbations, BIFI can automatically turn it into a usable fixer with high repair accuracy— $90.5\%$ accuracy on real bad code. We also experimented with continuing training the initial fixer $f_{0}$ with synthetic perturbations only, for the same rounds of BIFI (hence, controlling the amount of training data seen by the fixer); however, this did not provide an improvement, suggesting that there is a performance ceiling if we only train on synthetic data. + +DeepFix. Table 2 shows the test results on DeepFix, along with prior works. Here we use the existing best system DrRepair as our initial fixer ("Initial"). BIFI outperforms the initial fixer by a substantial margin (+5.6% absolute over DrRepair), achieving a state-of-the-art accuracy of 71.7%. It is notable that DrRepair was trained with manually-designed heuristic perturbations, where the authors (Yasunaga & Liang, 2020) studied and mimicked various code errors beginner and experienced programmers make (e.g., typos, punctuation and type errors); nevertheless, our result suggests that there is still room for improving the adaptation to a more realistic distribution of coding errors, and BIFI + +Table 4. Performance comparison with backtranslation on GitHub-Python. Backtranslation is equivalent to removing two components from BIFI: (i) using the critic to verify fix / break attempts (“critic”) and (ii) training the fixer on real bad examples in addition to examples generated by the breaker (“real bad”). The result suggests that both of these components improve the learning of a fixer, and consequently BIFI outperforms backtranslation. + +
Good codeBreaker output 1Breaker output 2
def del_record(self, desc): +record = self.find_one_desc) +records = self.find_desc) +if [record] != records: +raise ValueError( "Duplicate ]).format( str_desc)) +if record: +self.remove(record)def del_record(self, desc): +record = self.find_one_desc) +records = self.find_desc) +if [record] != records: +raise ValueError( "Duplicate ]).format( str_desc)) +if record: +self.remove(record)def del_record(self, desc): +record = self.find_one_desc) +records = self.find_desc) +if [record] != records: +raise ValueError( "Duplicate ]).format( str_desc)) +if record: self.remove(record)
+ +Figure 4. Example of breaker outputs. Given good code on the left, we sampled two outputs made by the breaker learned in BIFI round 1 (right). We observe that the breaker places large probability on errors seen in real bad code (i.e., obsolete usage of raise, unbalanced parentheses in nested context). + +
Bad codeFixer output (Round 0)Fixer output (Round 1)
def sanitize(x,r1,r2):def sanitize(x,r1,r2):def sanitize(x,r1,r2):
<if x>r1 and x<r2:<if x>r1 and x<r2:<if x>r1 and x<r2:
err = 0<err = 0<err = 0
<return err, x><return err, x>return err, x>
else:else:else:
<err = 1<err = 1<err = 1
return err, xreturn err, xreturn err, x
Error!Error!No error - fixed!
+ +Figure 5. Example of fixer outputs. Given the bad code on the left (with an indentation error), the initial fixer (center) attempts to fix it by inserting an indent token ( $\langle \mathbf{I} \rangle$ ) to line 3, but fails to adjust (delete) the indent token on the next line. The initial fixer commonly makes this mistake due to the distribution mismatch between real errors and synthetic perturbations on which the initial fixer was trained (see §4.3.4). After one round of BIFI, the fixer in round 1 (right) learns to insert and delete the correct pair of indent tokens, fixing the error. + +boosts repair accuracy without additional manual effort. + +# 4.3. Analysis + +We now analyze the key insights of BIFI. As the main properties of BIFI are to (i) add real bad examples to the training data if the critic accepts the fixer's output (the FixerOnly version), and to (ii) train the breaker to generate realistic bad examples (BIFI), we analyze their effects in §4.3.1 and §4.3.2. We also compare with backtranslation in §4.3.3. We then analyze how our fixer adapts towards real code distributions through quantitative and qualitative studies (§4.3.4). + +# 4.3.1. Effect of real bad examples + +FixerOnly enables training the fixer on real bad examples (but does not use the bad examples generated by the breaker). As Table 1 and 2 show, FixerOnly outperforms the initial fixer by a large margin (+27% on GitHub-Python). This result highlights the importance of training on real bad examples. + +We further analyze the effect of varying the amount of real bad examples, shown in Table 3. Here, "Bad $100\%$ " is our original setting (with 23K real bad examples available for BIFI and FixerOnly) and "Bad $50\%$ " means only $50\%$ of them (11.5K) are made available. "Synthetic bad only" means keeping training the fixer on synthetic bad examples only. We find that while the repair accuracy drops as we decrease the amount of available real bad examples, a small amount of real bad examples (e.g., "Bad $10\%$ " ) is still useful, + +
Code error category#ExamplesInitial Round-0 Acc.FixerOnlyBIFI
Round-1 Acc.Round-2 Acc.Round-1 Acc.Round-2 Acc.
Total1505562.0%86.8%92.4%88.0%90.5%
Unbalanced Parentheses399987.7%93.3%92.4%94.1%94.2%
Unclosed left parenthesis (not nested)22692.5%94.6%94.6%94.7%94.4%
Unclosed left parenthesis (nested)301485.8%92.8%91.7%93.8%93.8%
Redundant right parenthesis75993.8%95.3%94.7%95.4%95.7%
Indentation Error630739.4%79.5%83.7%81.3%85.9%
Expected indent431146.4%81.2%84.1%82.0%85.3%
Unexpected indent196624.6%76.8%83.8%80.9%88.4%
Invalid Syntax474970.5%90.9%92.0%91.6%93.5%
Missing colon66398.3%97.3%97.4%98.2%98.0%
Missing comma (single-line list/tuple/dict)69495.4%98.1%97.4%98.4%98.3%
Missing comma (multi-line list/tuple/dict)45188.9%92.5%92.0%94.5%94.9%
Missing newline5284.6%86.5%88.5%86.5%88.5%
Missing parenthesis pair63482.5%85.0%86.4%87.1%88.3%
Redundant comma15273.7%84.2%91.4%84.9%92.1%
Redundant parenthesis pair69813.8%80.7%86.1%80.1%89.4%
Invalid use of comma (e.g., "raise OSError, "msg"→"raise OSError("msg"))113861.3%98.8%99.1%98.7%99.4%
Other26760.7%66.3%64.4%67.4%66.7%
+ +Table 5. Code error categories in GitHub-Python, and repair accuracy. Due to the mismatch between real errors and synthetic perturbations used for training, the initial fixer has lower accuracy on "nested" than "not nested" for "unbalanced parentheses" errors, but it catches up in BIFI round 1, 2. Similarly, the initial fixer's repair accuracy is very low for "redundant parenthesis pair" and "indentation error", but it improves significantly in round 1, 2. This result illustrates the effect of BIFI adapting the fixer towards real errors. See §4.3.4 for more analysis. + +making FixerOnly perform better than using synthetic data alone (i.e., $78.5\%$ vs $62.7\%$ ). + +# 4.3.2. Effect of bad examples generated by breaker + +Recall that BIFI trains the fixer on both real bad examples and bad examples generated by the learned breaker. As Table 1 and 2 show, BIFI consistently provides an extra boost over FixerOnly, suggesting that the use of breaker outputs improves the fixer. Moreover, another benefit of the breaker is that one can sample many bad examples from the breaker to augment real bad examples, if their amount is limited. In Table 3 we find that BIFI is especially stronger than FixerOnly when the amount of available real bad examples is small (e.g., "Bad $10\%$ ) + +Figure 4 shows sample outputs made by the learned breaker $b_{1}$ given the good code on the left. We observe that the breaker generates errors seen in real bad code, i.e., obsolete usage of raise in Python3 (center) and unbalanced parentheses in nested context (right). Compared to random perturbations that arbitrarily drop/insert tokens, the learned breaker improves the coverage and efficiency of the training data for the fixer. + +# 4.3.3. Comparison with backtranslation + +Table 4 compares our method (BIFI) with backtranslation. As discussed in §3.3, backtranslation is equivalent to removing two components from BIFI: (i) using the critic to verify fix/break attempts in data generation ("critic" in Table) and (ii) training the fixer on real bad examples besides examples generated by the breaker ("real bad"). We find that removing each component from BIFI hurts the performance (e.g., $90\% \rightarrow 84\%$ ), which suggests that both components are important to improve the quality of training data. With these two innovations, BIFI outperforms backtranslation by + +a large margin $(+10\%$ absolute on GitHub-Python). + +# 4.3.4. How does the fixer adapt? + +We take a closer look at how our fixer performs and adapts towards the real distribution of bad code. Table 5 shows fine-grained categories of code errors seen in GitHub-Python, and their repair accuracy. + +In this categorization, we observe two examples of distribution mismatch between the real errors and synthetic perturbations: (i) random perturbations can generate this category of errors with high probability but with a wrong "sub-distribution" within it (e.g., can generate "unbalanced parentheses" or "missing comma" errors but do not match the low-level distribution of real bad code, such as errors occurring more often in nested parentheses or in a multi-line list/tuple/dict; recall the Figure 2 top example); (ii) random perturbations can only generate this category of errors with very small probability (e.g., "redundant parenthesis pair" and "indentation error", for which an exact pair of parentheses or indents/dedents need to be dropped or inserted; recall the Figure 2 bottom example). For (i), the result shows that the initial fixer trained with random perturbations has lower accuracy on "nested" than "not nested" for "unbalanced parentheses" errors, and on "multi-line" than "single-line" for "missing comma" errors; but the performance catches up in round 1,2, suggesting the effect of BIFI for addressing the low-level distribution mismatch. For (ii), the result shows that the initial fixer's repair accuracy is very low for "redundant parenthesis pair" and "indentation error", but it achieves significantly higher performance in round 1,2 (e.g., $39\% \rightarrow 85\%$ for indentation errors). A possible explanation is that as BIFI iteratively adds the successfully repaired cases to training, the fixer adapts to up-weight this category of error fixing, leading to improved accuracy. + +Figure 5 provides examples of fixer outputs. Given the bad code on the left (with an indentation error), the initial fixer (center) attempts to fix it by inserting an indent token $(\langle I\rangle)$ to line 3 but fails to adjust (delete) the indent token on the following line. The initial fixer commonly makes this mistake for indentation errors, due to the mismatch between real errors and synthetic perturbations discussed above. After one round of BIFI, the fixer (Figure 5 right) learns to insert and delete the correct pair of indents, fixing the error. + +# 5. Related work and discussion + +Learning to repair code. Several works learn to repair code from labeled datasets of source code edits made by programmers, e.g., error resolution records (Just et al., 2014; Chen et al., 2019; Mesbah et al., 2019; Bader et al., 2019; Tarlow et al., 2020; Ding et al., 2020). As labeled data is costly to prepare, various works study learning code fixers from unlabeled or synthetic data (Pu et al., 2016; Parihar et al., 2017; Ahmed et al., 2018; Pradel & Sen, 2018; Wang et al., 2018; Vasic et al., 2019; Gupta et al., 2019; Hajipour et al., 2019; Hellendoorn et al., 2020). In particular, Gupta et al. (2017) is an early work that randomly perturbs good code to prepare a synthetic paired data and trains a seq2seq neural network model as a fixer. Yasunaga & Liang (2020) improve on it by designing heuristic perturbations that mimic common errors made by programmers. Different from the above work, our method (BIFI) adapts a naive fixer trained with synthetic errors towards real errors without manual, domain-specific effort. For a more comprehensive review of automatic code repair, we refer readers to Monperrus (2020). + +Denoising autoencoding. Denoising autoencoding (Vincent et al., 2008) trains a model that recovers original data from randomly corrupted versions, and is widely used as an effective self-supervised representation learning and pretraining strategy, e.g., in computer vision (Erhan et al., 2010) and natural language processing (NLP) (Lewis et al. (2020), which randomly drops/ replaces tokens in a sentence and learns to recover). Our initial fixer trained with random perturbations is a denoising autoencoder. Crucially, instead of using it purely for representation learning, we show that through the BIFI algorithm, one can turn the vanilla denoising autoencoder into a usable fixer that repairs real-world bad examples with high accuracy. On a related note, Lee et al. (2019) adapt a denoising autoencoder into an autocomplete system. + +Domain adaptation. Domain adaptation aims to address the mismatch in data distribution between training and test domains (Daume III & Marcu, 2006; Quionero-Candela et al., 2009; Koh et al., 2021). Such domain shifts typically occur across related but different datasets (Torralba & Efros, 2011; Fang et al., 2013; Venkateswara et al., 2017; Yu et al., 2018b; 2019; Peng et al., 2019; Kamath et al., 2020), as well as from synthetic data to real data (including sim2real) (Wang et al., 2015; Ganin & Lempitsky, 2015; Richter et al., 2016; Peng et al., 2018; Hellendoorn et al., 2019; Xu et al., 2020; Bellemare et al., 2020), as synthetic data can be easier to obtain + +than real data. In our repair task, unpaired real data (code snippets on GitHub) is available but paired real data is costly to obtain. Hence we considered adaptation from synthetic paired data to real paired data. Within domain adaptation, our task is also related to the setting where unlabeled data in the test domain is available (Sun & Saenko, 2016; Hoffman et al., 2018; Sun et al., 2020) (in our case, real bad code). The difference is that as our outputs are structured, we have a critic to check if the fixer's output on the unlabeled data is correct Leveraging this property, BIFI takes the correct outputs to create training data in the test domain (Eq 6); and trains a breaker to generate more data that simulates the test domain (Eq 8). + +Data augmentation. Data augmentation aims to generate extra training data. A common approach is to increase the source side data, for instance by adding modifications or sampling from generative models (Hannun et al., 2014; Jia & Liang, 2016; Krizhevsky et al., 2017; Antoniou et al., 2017; Yasunaga et al., 2018; Yu et al., 2018a; Lee et al., 2019; Berthelot et al., 2019; Xie et al., 2020). Several works also study target side augmentation, which keeps multiple (valid) target predictions made by a model and adds to training. This is commonly used in structured generation problems such as semantic parsing, program synthesis and molecule generation (Liang et al., 2013; Berant et al., 2013; Guu et al., 2017; Min et al., 2019; Zhong et al., 2020; Yang et al., 2020). While our method also augments training data, it differs in two aspects: 1) we use the fixer and breaker to augment both the source and target sides; 2) our goal is not only to increase the amount of training data, but also to adapt to the distribution of interest (real bad examples). + +Self-training. Self-training (Lee, 2013; McClosky et al., 2006; Kumar et al., 2020; Xie et al., 2021) applies a trained model to unlabeled data, obtains predicted targets (pseudolabels), and uses them as extra training examples. Similarly, co-training (Blum & Mitchell, 1998) and tri-training (Zhou & Li, 2005) train multiple models and add predicted targets on which these models agree. Our method also applies trained models (breaker and fixer) to unlabeled data to generate targets, with a difference that we use the critic to verify the predictions and only keep correct ones. + +Unsupervised machine translation (MT). Unsupervised MT learns translators from unpaired corpora (Artetxe et al., 2018a; b; Lachaux et al., 2020). Backtranslation (Sennrich et al., 2016; Lample et al., 2018a; b) is a common approach that uses the target-to-source model to generate noisy sources and then trains the source-to-target model to reconstruct the targets (also related to cycle-consistency (Zhu et al., 2017; Hoffman et al., 2018) and style transfer (Shen et al., 2017; Yang et al., 2018; Zhang et al., 2019)). One may view the "bad-side" and "good-side" in our repair task as two source/target languages in MT and apply backtranslation. The main difference is that the repair task has a critic, which motivated our BIFI algorithm: BIFI (i) uses the critic to verify if the generated examples are actually fixed or broken (Eq 6, 8), and (ii) trains the fixer on real bad examples besides + +examples generated by the breaker (Eq 9). We found these techniques improve the correctness of the generated training data ( $\S 4.3.3$ ). While we focused on code repair in this work, we hope that BIFI can be applied to unsupervised MT and style transfer by introducing a human-based or learned critic. + +# 6. Conclusion + +We considered the problem of learning a fixer from unpaired data and a critic (code analyzer or compiler), and proposed a new approach, Break-It-Fix-It (BIFI). The idea of BIFI is to train a breaker and use the critic to amass more realistic and correct paired data for training the fixer. Using two code repair datasets (GitHub-Python and DeepFix), we showed how BIFI adapts baseline fixers towards realistic distributions of code errors, achieving improved repair performance. We note that BIFI is not about simply collecting more training data, but rather turning raw unlabeled data into usable paired data with the help of a critic. This is a potentially powerful and general framework applicable to many areas such as molecular design, text editing, and machine translation. + +# Acknowledgments + +We thank Michael Xie, members of the Stanford P-Lambda, SNAP and NLP groups, as well as our anonymous reviewers for valuable feedback. This work was supported in part by Funai Foundation Fellowship and NSF CAREER Award IIS-1552635. + +# Reproducibility + +Code and data are available at https://github.com/michiyasunaga/bifi. Experiments are available at https://worksheets.codalab.org/worksheets/0xfddb2ef01a9f4dc0b5d974a5a97174be. + +# References + +Ahmed, U. Z., Kumar, P., Karkare, A., Kar, P., and Gulwani, S. Compilation error repair: for the student programs, from the student programs. In International Conference on Software Engineering (ICSE), pp. 78-87, 2018. +Antoniou, A., Storkey, A., and Edwards, H. Data augmentation generative adversarial networks. arXiv preprint arXiv:1711.04340, 2017. +Artetxe, M., Labaka, G., and Agirre, E. Unsupervised statistical machine translation. arXiv preprint arXiv:1809.01272, 2018a. +Artetxe, M., Labaka, G., Agirre, E., and Cho, K. Unsupervised neural machine translation. In International Conference on Learning Representations (ICLR), 2018b. +Bader, J., Scott, A., Pradel, M., and Chandra, S. Getafix: Learning to fix bugs automatically. Proceedings of the ACM on Programming Languages, 3(OOPSLA):1-27, 2019. + +Bellemare, M. G., Candido, S., Castro, P. S., Gong, J., Machado, M. C., Moitra, S., Ponda, S. S., and Wang, Z. Autonomous navigation of stratospheric balloons using reinforcement learning. Nature, 588, 2020. +Berant, J., Chou, A., Frostig, R., and Liang, P. Semantic parsing on freebase from question-answer pairs. In Empirical Methods in Natural Language Processing (EMNLP), 2013. +Berthelot, D., Carlini, N., Goodfellow, I., Papernot, N., Oliver, A., and Raffel, C. A. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems (NeurIPS), 2019. +Blum, A. and Mitchell, T. Combining labeled and unlabeled data with co-training. In Conference on computational learning theory, 1998. +Chen, Z., Kommrusch, S. J., Tufano, M., Pouchet, L.-N., Poshyvanyk, D., and Monperrus, M. Sequencer: Sequence-to-sequence learning for end-to-end program repair. IEEE Transactions on Software Engineering, 2019. +Daume III, H. and Marcu, D. Domain adaptation for statistical classifiers. Journal of artificial Intelligence research, 2006. +Dinella, E., Dai, H., Li, Z., Naik, M., Song, L., and Wang, K. Hoppity: Learning graph transformations to detect and fix bugs in programs. In International Conference on Learning Representations (ICLR), 2020. +Ding, Y., Ray, B., Devanbu, P., and Hellendoorn, V. J. Patching as translation: the data and the metaphor. In Automated Software Engineering (ASE), 2020. +Erhan, D., Courville, A., Bengio, Y., and Vincent, P. Why does unsupervised pre-training help deep learning? In Artificial Intelligence and Statistics (AISTATS), pp. 201-208, 2010. +Fang, C., Xu, Y., and Rockmore, D. N. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. In International Conference on Computer Vision (ICCV), 2013. +Ganin, Y. and Lempitsky, V. Unsupervised domain adaptation by backpropagation. In International Conference on Machine Learning (ICML), 2015. +Gupta, R., Pal, S., Kanade, A., and Shevade, S. K. Deepfix: Fixing common C language errors by deep learning. In Association for the Advancement of Artificial Intelligence (AAAI), 2017. +Gupta, R., Kanade, A., and Shevade, S. Deep reinforcement learning for programming language correction. In Association for the Advancement of Artificial Intelligence (AAAI), 2019. + +Guu, K., Pasupat, P., Liu, E. Z., and Liang, P. From language to programs: Bridging reinforcement learning and maximum marginal likelihood. In Association for Computational Linguistics (ACL), 2017. +Hajipour, H., Bhattacharya, A., and Fritz, M. Samplefix: Learning to correct programs by sampling diverse fixes. arXiv preprint arXiv:1906.10502, 2019. +Hannun, A., Case, C., Casper, J., Catanzaro, B., Diamos, G., Elsen, E., Prenger, R., Satheesh, S., Sengupta, S., Coates, A., et al. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567, 2014. +Hellendoorn, V. J., Proksch, S., Gall, H. C., and Bacchelli, A. When code completion fails: A case study on real-world completions. In International Conference on Software Engineering (ICSE), 2019. +Hellendoorn, V. J., Sutton, C., Singh, R., Maniatis, P., and Bieber, D. Global relational models of source code. In International Conference on Learning Representations (ICLR), 2020. +Hoffman, J., Tzeng, E., Park, T., Zhu, J.-Y., Isola, P., Saenko, K., Efros, A., and Darrell, T. Cycada: Cycle-consistent adversarial domain adaptation. In International Conference on Machine Learning (ICML), 2018. +Jia, R. and Liang, P. Data recombination for neural semantic parsing. In Association for Computational Linguistics (ACL), 2016. +Jin, W., Yang, K., Barzilay, R., and Jaakkola, T. Learning multimodal graph-to-graph translation for molecular optimization. In International Conference on Learning Representations (ICLR), 2019. +Just, R., Jalali, D., and Ernst, M. D. Defects4j: A database of existing faults to enable controlled testing studies for java programs. In Proceedings of the 2014 International Symposium on Software Testing and Analysis, pp. 437-440, 2014. +Kamath, A., Jia, R., and Liang, P. Selective question answering under domain shift. In Association for Computational Linguistics (ACL), 2020. +Kingma, D. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. +Koh, P. W., Sagawa, S., Marklund, H., Xie, S. M., Zhang, M., Balsubramani, A., Hu, W., Yasunaga, M., Phillips, R. L., Beery, S., et al. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning (ICML), 2021. +Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 2017. + +Kumar, A., Ma, T., and Liang, P. Understanding self-training for gradual domain adaptation. In International Conference on Machine Learning (ICML), 2020. +Lachaux, M.-A., Roziere, B., Chanussot, L., and Lample, G. Unsupervised translation of programming languages. In Advances in Neural Information Processing Systems (NeurIPS), 2020. +Lample, G., Conneau, A., Denoyer, L., and Ranzato, M. Unsupervised machine translation using monolingual corpora only. In International Conference on Learning Representations (ICLR), 2018a. +Lample, G., Ott, M., Conneau, A., Denoyer, L., and Ranzato, M. Phrase-based & neural unsupervised machine translation. In Empirical Methods in Natural Language Processing (EMNLP), 2018b. +Lee, D.-H. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, International Conference on Machine Learning (ICML), 2013. +Lee, M., Hashimoto, T. B., and Liang, P. Learning autocomplete systems as a communication game. In Advances in Neural Information Processing Systems (NeurIPS) Workshop on Emergent Communication, 2019. +Levenshtein, V. I. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, 1966. +Lewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., and Zettlemoyer, L. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Association for Computational Linguistics (ACL), 2020. +Liang, P., Jordan, M. I., and Klein, D. Learning dependency-based compositional semantics. Computational Linguistics, 2013. +McClosky, D., Charniak, E., and Johnson, M. Effective self-training for parsing. In North American Association for Computational Linguistics (NAACL), 2006. +Mesbah, A., Rice, A., Johnston, E., Glorioso, N., and Aftandilian, E. Deepdelta: learning to repair compilation errors. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 925-936, 2019. +Min, S., Chen, D., Hajishirzi, H., and Zettlemoyer, L. A discrete hard em approach for weakly supervised question answering. In Empirical Methods in Natural Language Processing (EMNLP), 2019. +Monperrus, M. The living review on automated program repair. Technical Report hal-01956501. HAL/archivesouvertes.fr., 2020. + +Parihar, S., Dadachanzi, Z., Praveen Kumar Singh, R. D., Karkare, A., and Bhattacharya, A. Automatic grading and feedback using program repair for introductory programming courses. In ACM Conference on Innovation and Technology in Computer Science Education, 2017. +Pascanu, R., Mikolov, T., and Bengio, Y. On the difficulty of training recurrent neural networks. In International conference on machine learning (ICML), pp. 1310-1318, 2013. +Peng, X., Usman, B., Kaushik, N., Wang, D., Hoffman, J., and Saenko, K. Visda: A synthetic-to-real benchmark for visual domain adaptation. In Computer Vision and Pattern Recognition (CVPR), 2018. +Peng, X., Bai, Q., Xia, X., Huang, Z., Saenko, K., and Wang, B. Moment matching for multi-source domain adaptation. In International Conference on Computer Vision (ICCV), 2019. +Pradel, M. and Sen, K. Deepbugs: A learning approach to name-based bug detection. Proceedings of the ACM on Programming Languages, 2(OOPSLA):1-25, 2018. +Pu, Y., Narasimhan, K., Solar-Lezama, A., and Barzilay, R. sk-p: a neural program corrector for moocs. In Companion Proceedings of the 2016 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity, pp. 39-40, 2016. +Quionero-Candela, J., Sugiyama, M., Schwaighofer, A., and Lawrence, N. D. Dataset shift in machine learning. The MIT Press, 2009. +Richter, S. R., Vineet, V., Roth, S., and Koltun, V. Playing for data: Ground truth from computer games. In European conference on computer vision, 2016. +Sennrich, R., Haddow, B., and Birch, A. Improving neural machine translation models with monolingual data. In Association for Computational Linguistics (ACL), 2016. +Seo, H., Sadowski, C., Elbaum, S., Aftandilian, E., and Bowdidge, R. Programmers' build errors: A case study at google. In International Conference on Software Engineering (ICSE), 2014. +Shen, T., Lei, T., Barzilay, R., and Jaakkola, T. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems (NeurIPS), 2017. +Sun, B. and Saenko, K. Deep coral: Correlation alignment for deep domain adaptation. In European Conference on Computer Vision (ECCV), 2016. +Sun, Y., Wang, X., Liu, Z., Miller, J., Efros, A. A., and Hardt, M. Test-time training for out-of-distribution generalization. In International Conference on Machine Learning (ICML), 2020. + +Taghipour, K. and Ng, H. T. A neural approach to automated essay scoring. In Empirical Methods in Natural Language Processing (EMNLP), 2016. +Tarlow, D., Moitra, S., Rice, A., Chen, Z., Manzagol, P.-A., Sutton, C., and Aftandilian, E. Learning to fix build errors with graph2diff neural networks. In Proceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops, pp. 19-20, 2020. +Torralba, A. and Efros, A. Unbiased look at dataset bias. In Computer Vision and Pattern Recognition (CVPR), 2011. +Vasic, M., Kanade, A., Maniatis, P., Bieber, D., and Singh, R. Neural program repair by jointly learning to localize and repair. In International Conference on Learning Representations (ICLR), 2019. +Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), 2017. +Venkateswara, H., Eusebio, J., Chakraborty, S., and Panchanathan, S. Deep hashing network for unsupervised domain adaptation. In Computer Vision and Pattern Recognition (CVPR), pp. 5018-5027, 2017. +Vincent, P., Larochelle, H., Bengio, Y., and Manzagol, P.-A Extracting and composing robust features with denoising autoencoders. In International Conference on Machine Learning (ICML), 2008. +Wang, K., Singh, R., and Su, Z. Dynamic neural program embeddings for program repair. In International Conference on Learning Representations (ICLR), 2018. +Wang, Y., Berant, J., and Liang, P. Building a semantic parser overnight. In Association for Computational Linguistics (ACL), 2015. +Xie, Q., Dai, Z., Hovy, E., Luong, M.-T., and Le, Q. V. Unsupervised data augmentation for consistency training In Advances in Neural Information Processing Systems (NeurIPS), 2020. +Xie, S. M., Kumar, A., Jones, R., Khani, F., Ma, T., and Liang, P. In-n-out: Pre-training and self-training using auxiliary information for out-of-distribution robustness In International Conference on Learning Representations (ICLR), 2021. +Xu, S., Semnani, S. J., Campagna, G., and Lam, M. S. Autoqa: From databases to qa semantic parsers with only synthetic training data. In Empirical Methods in Natural Language Processing (EMNLP), 2020. +Yang, K., Jin, W., Swanson, K., Barzilay, R., and Jaakkola, T. Improving molecular design by stochastic iterative target augmentation. In International Conference on Machine Learning (ICML), 2020. + +Yang, Z., Hu, Z., Dyer, C., Xing, E. P., and Berg-Kirkpatrick, T. Unsupervised text style transfer using language models as discriminators. In Advances in Neural Information Processing Systems (NeurIPS), 2018. +Yasunaga, M. and Liang, P. Graph-based, self-supervised program repair from diagnostic feedback. In International Conference on Machine Learning (ICML), 2020. +Yasunaga, M., Kasai, J., and Radev, D. Robust multilingual part-of-speech tagging via adversarial training. In North American Association for Computational Linguistics (NAACL), 2018. +Yu, T., Yasunaga, M., Yang, K., Zhang, R., Wang, D., Li, Z., and Radev, D. Syntaxsqlnet: Syntax tree networks for complex and cross-domaintext-to-sql task. In Empirical Methods in Natural Language Processing (EMNLP), 2018a. +Yu, T., Zhang, R., Yang, K., Yasunaga, M., Wang, D., Li, Z., Ma, J., Li, I., Yao, Q., Roman, S., et al. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. In Empirical Methods in Natural Language Processing (EMNLP), 2018b. +Yu, T., Zhang, R., Yasunaga, M., Tan, Y. C., Lin, X. V., Li, S., Er, H., Li, I., Pang, B., Chen, T., et al. Sparc: Cross-domain semantic parsing in context. In Association for Computational Linguistics (ACL), 2019. +Zhang, Z., Ren, S., Liu, S., Wang, J., Chen, P., Li, M., Zhou, M., and Chen, E. Style transfer as unsupervised machine translation. In Association for the Advancement of Artificial Intelligence (AAAI), 2019. +Zhong, V., Lewis, M., Wang, S. I., and Zettlemoyer, L. Grounded adaptation for zero-shot executable semantic parsing. In Empirical Methods in Natural Language Processing (EMNLP), 2020. +Zhou, Z.-H. and Li, M. Tri-training: Exploiting unlabeled data using three classifiers. IEEE Transactions on knowledge and Data Engineering, 2005. +Zhu, J.-Y., Park, T., Isola, P., and Efros, A. A. Unpaired image-to-image translation using cycle-consistent adversarial networks. In International Conference on Computer Vision (ICCV), 2017. \ No newline at end of file diff --git a/breakitfixitunsupervisedlearningforprogramrepair/images.zip b/breakitfixitunsupervisedlearningforprogramrepair/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ca279dc9801f690f4e3af4f55a25e20d2a9686ae --- /dev/null +++ b/breakitfixitunsupervisedlearningforprogramrepair/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c292318548c86c44f9df39ece48770d826e30b40418adab59bbf2acff2c25322 +size 497548 diff --git a/breakitfixitunsupervisedlearningforprogramrepair/layout.json b/breakitfixitunsupervisedlearningforprogramrepair/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a6d59f55d674a3444988bf4d262382c07c885d6f --- /dev/null +++ b/breakitfixitunsupervisedlearningforprogramrepair/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44d68b83080973c0dc6fb79cd765a99ad79192a70c6f9ec513c950b563505b7b +size 471746 diff --git a/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_content_list.json b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e9d0525dbc2931a72f32925102001b3ef8e82951 --- /dev/null +++ b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddeddc6ba01b8cf456d8036482e9de6d128ec954337ea21aaa4c650b168e4f28 +size 101588 diff --git a/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_model.json b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f9572a95c04a012ea620e1d956b661bd913a7f60 --- /dev/null +++ b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36fa84efcd1c319d035a90e8f8b16eb8cff03c5a31a754ed222ded8376a088e7 +size 127503 diff --git a/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_origin.pdf b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..27ed57fd62b3ae038cbc37d6b087fd12f3bd3c58 --- /dev/null +++ b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/170cca9e-24ba-45a6-80ef-412597f71faf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7256ded5886b880e64d3120574d7720795c4f50a676f4871084b4242e9914e4b +size 724996 diff --git a/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/full.md b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fa845e0d86a6888a1e43446e5fa05a10ef96f5b2 --- /dev/null +++ b/bridgingmultitasklearningandmetalearningtowardsefficienttrainingandeffectiveadaptation/full.md @@ -0,0 +1,456 @@ +# Bridging Multi-Task Learning and Meta-Learning: Towards Efficient Training and Effective Adaptation + +Haoxiang Wang1 Han Zhao1 Bo Li1 + +# Abstract + +Multi-task learning (MTL) aims to improve the generalization of several related tasks by learning them jointly. As a comparison, in addition to the joint training scheme, modern meta-learning allows unseen tasks with limited labels during the test phase, in the hope of fast adaptation over them. Despite the subtle difference between MTL and meta-learning in the problem formulation, both learning paradigms share the same insight that the shared structure between existing training tasks could lead to better generalization and adaptation. In this paper, we take one important step further to understand the close connection between these two learning paradigms, through both theoretical analysis and empirical investigation. Theoretically, we first demonstrate that MTL shares the same optimization formulation with a class of gradient-based meta-learning (GBML) algorithms. We then prove that for over-parameterized neural networks with sufficient depth, the learned predictive functions of MTL and GBML are close. In particular, this result implies that the predictions given by these two models are similar over the same unseen task. Empirically, we corroborate our theoretical findings by showing that, with proper implementation, MTL is competitive against state-of-the-art GBML algorithms on a set of few-shot image classification benchmarks. Since existing GBML algorithms often involve costly second-order bi-level optimization, our first-order MTL method is an order of magnitude faster on large-scale datasets such as miniImageNet. We believe this work could help bridge the gap between these two learning paradigms, and provide a computationally efficient alternative to GBML that also supports fast task adaptation. + +# 1. Introduction + +Multi-task learning has demonstrated its efficiency and effectiveness on learning shared representations with training data from multiple related tasks simultaneously (Caruana, 1997; Ruder, 2017; Zhang & Yang, 2017). Such shared representations could transfer to many real-world applications, such as object detection (Zhang et al., 2014), image segmentation (Kendall et al., 2018), multi-lingual machine translation (Dong et al., 2015), and language understanding evaluation (Wang et al., 2019). On the other hand, in addition to the joint training scheme, modern meta-learning can leverage the shared representation to fast adapt to unseen tasks with only minimum limited data during the test phase (Hospedales et al., 2020). As a result, meta-learning has drawn increasing attention and been applied to a wide range of learning tasks, including few-shot learning (Snell et al., 2017; Vinyals et al., 2016; Lee et al., 2019b), meta reinforcement learning (Finn et al., 2017), speech recognition (Hsu et al., 2020) and bioinformatics (Luo et al., 2019). + +Despite their subtle differences in problem formulation and objectives, both MTL and meta-learning aim to leverage the correlation between different tasks to enable better generalization to either seen or unseen tasks. However, a rigorous exploration of this intuitive observation is severely lacking in the literature. As a result, while being effective on fast adaptation to unseen tasks, many meta-learning algorithms still suffer from expensive computational costs (Nichol et al., 2018a; Antoniou et al., 2019; Hospedales et al., 2020). On the other hand, while being efficient in training, due to its problem formulation, MTL does not allow adaptation to unseen tasks, at least in a straightforward manner. Hence, a natural question to ask is, + +Can we combine the best of both worlds from MTL and meta-learning, i.e., fast adaptation to unseen tasks with efficient training? + +To answer this question, one needs to first understand the relationship between MTL and meta-learning in greater depth. To this end, in this paper, we take the first attempt with the goal to bridge these two learning paradigms. In particular, we focus on a popular class of meta-learning methods, gradient-based meta-learning (GBML), which takes a + +bi-level optimization formulation inspired from the Model-Agnostic Meta-Learning (MAML) (Finn et al., 2017). From an optimization perspective, we first show that MTL and a class of GBML algorithms share the same optimization formulation. Inspired by this simple observation, we then prove that, for sufficiently wide neural networks, these two methods lead to close predictors: on any test task, the predictions given by these two methods are similar, and the gap is inversely proportional to the network depth. Our theoretical results imply that, in principle, it is possible to improve the existing MTL methods to allow fast adaptation to unseen tasks, without loss in its training efficiency, and thus provide an affirmative answer to the above question. + +Empirically, to corroborate our findings, we first conduct a series of experiments on synthetic data to show the increasing closeness between the predictors given by MTL and GBML, as the network depth grows. We then perform extensive experiments to show that with proper implementation, MTL can achieve similar or even better results than the state-of-the-art GBML algorithms, while enjoys significantly lower computational costs. This indicates that MTL could be potentially applied as a powerful and efficient alternative to GBML for meta-learning applications. + +Our contributions could be briefly summarized as follows: + +- Bridging MTL and GBML from the optimization perspective: We show that MTL and a class of GBML algorithms share the same optimization formulation. In particular, GBML takes a regularized bi-level optimization while MTL adopts the simple joint training. +- Closeness in the function space: we prove that for over-parameterized neural nets with sufficient width, the learned predictive functions of MTL and a GBML algorithm are close in the function space, indicating their predictions are similar on unseen (test) tasks. Furthermore, we empirically validate this theoretical result on synthetic data. +- Empirical performance and efficiency: Motivated by our theoretical results, we implement MTL with modern deep neural nets, and show that the performance of MTL is competitive against MetaOptNet (Lee et al., 2019b), a state-of-the-art GBML algorithm, on few-shot image classification benchmarks. Notably, the training of MTL is an order of magnitude faster than that of MetaOptNet, due to its first-order optimization. The code is released at https://github.com/AI-secure/multi-task-learning + +# 2. Related Work + +Multi-Task Learning Multi-task learning (MTL) is a method to jointly learn shared representations from multiple training tasks (Caruana, 1997). Past research on MTL + +is abundant. Theoretical results on learning shared representation with MTL have shown that the joint training scheme is more sample efficient than single-task learning, at least under certain assumptions of task relatedness, linear features and model classes (Maurer et al., 2016; Tripuraneni et al., 2020). Other works on MTL include designing more efficient optimization methods to explore the task and feature relationships (Evgeniou & Pontil, 2007; Argyriou et al., 2008; Zhang & Yeung, 2010; Zhao et al., 2020). + +Meta-Learning Meta-learning, or learning-to-learn, is originally proposed for few-shot learning tasks (Thrun & Pratt, 1998; Baxter, 1998), where the goal is fast adaptation to unseen tasks. Among various meta-learning methods, a line of works following MAML, termed as gradient-based meta-learning (GBML) (Finn et al., 2017; Rajeswaran et al., 2019), has been increasingly applied in many downstream application domains. Recent works on understanding GBML have shown that MAML is implicitly performing representation learning, which is the key to its empirical success (Raghu et al., 2020). In particular, Saunshi et al. (2020) compares MTL and Reptile (Nichol et al., 2018b), a first-order variant of MAML, in a toy setting of $1d$ subspace learning with 2-layer linear models, and shows the upper bounds of their sample complexity are of the same order. In contrast, our theory is compatible with non-linear neural nets of any depth and has no restriction on the input dimension, which is a more realistic and practical setting. In addition to GBML, the considered MTL implementation shares some similarities with metric-based meta-learning (i.e., metric learning) methods in few-shot learning scenarios (Snell et al., 2017; Vinyals et al., 2016), since here we also only keep the trained hidden layers for test. + +# 3. Preliminaries + +We first provide a brief discussion to the common network architectures, training algorithms, and evaluation protocols for MTL and GBML. + +# 3.1. Neural Networks Architectures + +Consider a $L$ -layer fully-connected neural network $f_{\theta} \colon \mathbb{R}^d \mapsto \mathbb{R}^k$ , which contains $h_l$ neurons in the $l$ -th hidden layer for $l \in [L - 1]$ . Denote the parameters of the first $L - 1$ layers (i.e., hidden layers) as $\theta^{< L}$ , and the last hidden layer output (i.e., network representation/features) as $\phi_{\theta^{< L}}^{\top} \colon \mathbb{R}^d \mapsto \mathbb{R}^{h_{L - 1}}$ . For simplicity, we assume the output layer (i.e., network head) has no bias, and denote it as $w \in \mathbb{R}^{h_{L - 1} \times k}$ . Thus, for any input $x \in \mathbb{R}^d$ , the neural network output can be expressed as + +$$ +f _ {\theta} (x) = \phi_ {\theta < L} ^ {\top} (x) w. +$$ + +Networks used in MTL often have a multi-head structure, where each head corresponds to a training task. In this + +case, the shared hidden layers are treated as the shared representations. Formally, denote a $L$ -layer $N$ -head neural network as $\hat{f}_{\hat{\theta}}\colon \mathbb{R}^d\times [N]\mapsto \mathbb{R}^k$ , s.t. for any input $x\in \mathbb{R}^d$ and head index $i\in [N]$ , the network output is + +$$ +\hat {f} _ {\hat {\theta}} (x, i) = \phi_ {\hat {\theta} < L} ^ {\top} (x) \hat {w} ^ {(i)}, \tag {1} +$$ + +where $\phi_{\hat{\theta} < L}(x)$ is the last hidden layer output, $\hat{\theta}^{< L}$ is the parameters of first $L - 1$ layers, and $w_{i}$ is the $i$ -th head in the output layer. Note that the network parameters are the union of parameters in the hidden layers and multi-head output layer, i.e., $\hat{\theta} = \{\hat{\theta}^{< L}\} \cup \{\hat{w}^{(i)}\}_{i\in [N]}$ . + +# 3.2. Multi-Task Learning + +In MTL, a multi-head neural net with $N$ heads is trained over $N$ training tasks each with $n$ samples (Ruder, 2017). For $i \in [N]$ , denote the data for the $i$ -th task as $(X_i, Y_i)$ where $X_i \in \mathbb{R}^{n \times d}$ and $Y_i \in \mathbb{R}^{n \times k}$ . The training of MTL is to minimize the following objective given loss function $\ell$ , + +$$ +\min _ {\hat {\theta}} \mathcal {L} _ {M T L} (\hat {\theta}) := \sum_ {i \in [ N ]} \ell \left(\phi_ {\hat {\theta} < L} ^ {\top} \left(X _ {i}\right) \hat {w} ^ {(i)}, Y _ {i}\right) \tag {2} +$$ + +where $\phi_{\hat{\theta} < L}^{\top}(X_i) \coloneqq \left(\phi_{\hat{\theta}}^{\top}(x)\right)_{x \in [X_i]}\in \mathbb{R}^{n\times h_{L - 1}}$ + +# 3.3. Gradient-Based Meta-Learning and ANIL + +Here we introduce a representative algorithm of GBML, Almost-No-Inner-Loop (ANIL) (Raghu et al., 2020), which is a simplification of MAML. The setup is the same as Sec. 3.2, where $N$ training tasks each with $n$ sample-label pairs are provided, i.e., $\{X_i,Y_i\}_{i=1}^N$ . In practice, a training protocol, query-support split (cf. Appendix A for more details), is often adopted. However, recent work has shown that such a split is not necessary (Bai et al., 2021). Hence, we do not consider the query-support split through this work. + +ANIL minimizes the following loss over $\theta = \{\theta^{