Learning Predictions for Algorithms with Predictions
Abstract
A burgeoning paradigm in algorithm design is the ﬁeld of algorithms with predictions , in which algorithms can take advantage of a possibly-imperfect prediction of some aspect of the problem.
While much work has focused on using predictions to improve competitive ratios, running times, or other performance measures, less effort has been devoted to the question of how to obtain the predictions themselves, especially in the critical online setting.
We introduce a general design approach for algorithms that learn predictors: (1) identify a functional dependence of the performance measure on the prediction quality and (2) apply techniques from online learning to learn predictors, tune robustness-consistency trade-offs, and bound the sample complexity.
We demonstrate the effectiveness of our approach by applying it to bipartite matching, ski-rental, page migration, and job scheduling.
In several settings we improve upon multiple existing results while utilizing a much simpler analysis, while in the others we provide the ﬁrst learning-theoretic guarantees.
Introduction
Algorithms with predictions, a subﬁeld of beyond-worst-case analysis of algorithms [36], aims to design methods that make use of machine-learned predictions in order to reduce runtime, error or some other performance cost.
Mathematically, for some prediction x , algorithms in this ﬁeld are designed such that their cost C t ( x ) on an instance t is upper-bounded by some measure U t ( x ) of the quality of the prediction on that instance.
The canonical example here is that the cost of binary search on a sorted array of size n can be improved from O (log n ) to ≤ U t ( x ) = 2 log η t ( x ) , where η t ( x ) is the distance between the true location of a query t in the array and the location predicted by the predictor x [36].
In recent years, algorithms whose cost depends on the quality of possibly imperfect predictions have been developed for numerous important problems, including caching [41, 24, 34], scheduling [30, 43], ski-rental [29, 1, 15], bipartite matching [16], page migration [22], and many more [10, 17, 36].
While there has been a signiﬁcant effort to develop algorithms that use earned predictions, until very recently [13, 33] there has been less focus on actually learning to predict.
For example, of the works listed only two on ski-rental [1, 15] and one other [16] show sample complexity guarantees, and none consider the important online learning setting, in which problem instances may not come from a ﬁxed distribution.
This is in contrast to the related area of data-driven algorithm design [19, 3], which has established techniques such as dispersion [6] and others [8, 11] for deriving learning-theoretic guarantees, leading to end-to-end results encompassing both learning and computation.
It is also despite the fact that, as we see in this work, learning even simple predictors is in many cases a non-trivial problem.
We bridge this gap and provide a framework for obtaining learning-theoretic guarantees for algorithms with predictions.
In addition to improving sample complexity bounds, we show how to learn the parameters of interest in an setting with low overall regret.
We accomplish this using a two- [Table] step approach inspired by recent work on theoretical meta-learning [25], which has been used to derive numerous multi-task learning results by optimizing regret-upper-bounds that encode the tasksimilarity [31, 32, 9, 26].
As evidenced by our results in Table 1, we believe the following two-step framework below holds similar potential for obtaining guarantees for algorithms with predictions:
For a given algorithm, derive a convenient-to-optimize upper bound
U t ( x ) on the cost C t ( x ) that depends on both the prediction x and information speciﬁc to instance t returned once the algorithm terminates, e
g. the optimum in combinatorial optimization.
We ﬁnd that in many cases such bounds already exist, and the quality of the prediction can be measured by a distance from some ground truth obtained from the output, a quantity that is usually convex and thus learnable.
Apply online learning to obtain both regret guarantees against adversarial sequences and sample complexity bounds for i.i.d.
instances.
We provide pseudo-code for a generic setup in Algorithm 1.
Table 1 summarizes instantiations of our framework on multiple problems.
Our approach is designed to be simple-to-execute, leaving much of the difﬁculty to what the ﬁeld is already good at: designing algorithms and proving prediction-quality-dependent upper bounds on their costs.
Once the latter is accomplished, our framework leverages problem-speciﬁc structure to design a customized learning algorithm for each problem, leading to strong regret and sample complexity guarantees.
In particular, in multiple settings we improve upon existing results in either sample complexity or generality, and in all cases we are the ﬁrst to show regret guarantees in the online setting.
This demonstrates the usefulness of and need for such a theoretical framework for studying these problems.
We summarize the diverse set of contributions enabled by our theoretical framework below:
Bipartite matching: Our starting example builds upon the work on minimum-weight bipartite matching using the Hungarian algorithm by Dinitz et al.
We show how our framework leads directly to both the ﬁrst regret guarantees in the online setting and new sample complexity bounds that improve over the previous approach by a factor linear in the number of nodes.
In the Appendix we show similar strong improvements for b -matching and other graph algorithms.
Page migration: We next study a more challenging application, online page migration , and show how we can adapt the algorithmic guarantee of Indyk et al.
[22] into a learnable upper bound for which we can again provide both adversarial and statistical guarantees.
Learning linear maps with instance-feature inputs: Rather than assume the existence of a strong ﬁxed prediction, it is often more natural to assume each instance comes with features that can be input into a predictor such as a linear map.
Our approach yields the ﬁrst guarantees for learning linear predictors for algorithms with predictions, which we obtain for the ﬁrst two problem settings and also for online job scheduling using makespan minimization [30].
Tuning robustness-consistency trade-offs: Many bounds for online algorithms with predictions incorporate parameterized trade-offs between trusting the prediction or falling back on a worst-case approximation.
This suggests the usefulness of tuning the trade-off parameter, which we instantiate on a simple job scheduling problem with a ﬁxed predictor.
Then we turn to the more challenging problem of simultaneously tuning the trade-off and learning predictions, which we achieve on two variants of the ski-rental problem. For the discrete case we give the only learning-theoretic guarantee, while for the continuous case our bound uses a dispersion assumption [6] that, in the i.i.d. setting, is a strictly weaker assumption than the log-concave requirement of Diakonikolas et al.
Related work
Algorithms with predictions is a type of beyond-worst-case analysis of algorithms [42]; along with areas like smooth analysis [45] and data-driven algorithm design [3], it takes advantage of the fact that real-world instances are not worst-case.
Inspired by success in applications such as learned indices [27], there has been a great deal of theoretical study focusing on algorithms whose guarantees depend on the quality of a given predictor (c.f. the Mitzenmacher and Vassilvitskii [36] survey).
The actual learning of this predictor has been studied less [1, 15, 16] and rarely in the online setting; we aim to change this with our study.
Some papers improve online learning itself using predictions [39, 23, 14], but they also assume known predictors or only learn over a small set of policies, and their goal is minimizing regret not computation.
In-general, we focus on showing how algorithms with predictions can make use of online learning rather than on new methods for the latter.
Several works [4, 40, 2] use learning while advising an algorithm, in-effect taking a learning-inspired approach to better make use of a prediction within an algorithm, whereas we focus on learning the prediction outside of the target algorithm.
Our paper presents the ﬁrst general framework for efﬁciently learning useful predictors.
Data-driven algorithm design is a related area that has seen more learning-theoretic effort [19, 6, 3].
At a high-level, it often studies tuning parameters such as the gradient descent step-size [19] or settings of branch and bound [5], whereas the predictors in algorithms with predictions guess the sequence in an online algorithm [22] or the actual outcome of the computation [16].
The distinction can be viewed as terminological, since a prediction can be viewed as a parameter, but it can mean that in our settings we have full information about the loss function since it is typically some discrepancy between the full sequence or computational outcome and the prediction.
In contrast, in data-driven algorithm design getting the cost of each parameter often requires additional computation, leading to (semi-)bandit settings [7].
A more salient difference is that data-driven algorithm design guarantees compete with the parameter that minimizes average cost but do not always quantify the improvement attainable via learning; in algorithms with predictions we do generally quantify this improvement with an upper bound on the cost that depends on the prediction quality, but we usually only compete with the parameter that is optimal for prediction quality, which is not always cost-optimal.
We do adapt data-driven algorithm design tools like dispersion [6] for algorithms with predictions.
Our two-step approach to providing guarantees for algorithms with predictions is inspired by the
Average Regret-Upper-Bound Analysis (ARUBA) framework [25] for studying meta-learning [18].
Instead of instances they have tasks with different data-points, and the upper bounds are on learningtheoretic quantities such as regret rather than computational costs such as runtime.
Mathematically,
ARUBA takes advantage of similar structure in the regret-upper-bounds that we ﬁnd in algorithms with predictions, namely that the upper bounds encode some measure of the quality of the prediction (in their case an initialization for gradient descent) via a comparison to the ground-truth (in their case the optimal parameter).
However, whereas in ARUBA the need to know this optimal parameter after seeing a task is a weakness that does not hold in practice, in algorithms with predictions the corresponding quantity—the feedback listed in Table 1—is generally known after seeing the instance.
Framework overview and application to bipartite matching
In this section we outline the theoretical framework for designing algorithms and proving guarantees for learned predictors.
As an illustrative example we will use the Hungarian algorithm for bipartite matching, for which Dinitz et al.
[16] demonstrated an instance-dependent upper bound on the running time using a learned dual vector.
Along the way, we will show an improvement to their sample complexity bound together with the ﬁrst online results for this setting.
Bipartite matching:
For a bipartite graph on n nodes and m edges, min-weight perfect matching (MWPM) asks for the perfect matching with the least weight according to edge-costs c ∈
Z m ≥ 0 .
A common approach here is the Hungarian algorithm, a convex optimization-based approach for which
Dinitz et al.
[16] showed a runtime bound of ˜ O
( m √ n min {(cid:107) x − x ∗ ( c ) (cid:107) 1 , √ n } ) , where x ∈ Z n initializes the duals in a primal-dual algorithm and
x ∗ ( c ) ∈
Z n is dual of the optimal solution; note that the latter is obtained for free after running the Hungarian method.
Step 1 - Upper bound:
The ﬁrst step of our approach is to ﬁnd a suitable function U t ( x ) of the prediction x that (a) upper bounds the target algorithm’s cost C t ( x ) , (b) can be constructed completely once the algorithm terminates, and (c) can be efﬁciently optimized.
These qualities allow learning the predictor in the second step.
The requirements are similar to those of ARUBA for showing results for meta-learning [25], although there the quantity being upper-bounded was regret, not algorithmic cost.
Algorithm algorithm
X predictor method AlgorithmWithPrediction that takes advice from X and returns upper bounds U t on its cost.
The goal of OnlineAlgorithm is low regret over the sequence U t , so that on-average C t is upper bounded by the smallest possible average of U t , up to some error decreasing in T .
For speciﬁc instantiations of algorithms and feedback see Table 1.
initialize x 1 ∈ X for OnlineAlgorithm for instance t = 1 , . .
, T do obtain instance I t run AlgorithmWithPrediction( I t , x t ) suffer cost C t ( x t ) ≤ U t ( x t ) get feedback to construct upper bound
U t x t +1 ← OnlineAlgorithm( U t , x t )
Many guarantees for algorithms with predictions are already amenable to being optimized, although we will see that they can require some massaging in order to be useful.
In many cases the guarantee is a distance metric between the prediction x and some instance-dependent perfect prediction x ∗ , which is convex and thus straightforward to learn.
This is roughly true of our bipartite matching example, although taking the minimum of a constant and the distance (cid:107) x − x ∗ ( c ) (cid:107) 1 between the predicted and actual duals makes the problem non-convex.
However, we can further upper bound their result by ˜ O ( m √ n (cid:107) x − x ∗ ( c ) (cid:107) 1 ) ; note that Dinitz et al.
[16] also optimize this quantity, not the tighter upper bound with the minimum.
While this might seem to be enough for step one, Dinitz et al.
[16] also require the prediction x to be integral, which is difﬁcult to combine with standard online procedures.
In order to get around this issue, we show that rounding any nonnegative real vector to the closest integer vector incurs only a constant multiplicative loss in terms of the (cid:96) 1 -distance.
Claim 3.1.
Given any vectors x ∈ Z n and y ∈ R n , let ˜y ∈
Z n be the vector whose elements are those of y rounded to the nearest integer.
Then (cid:107) x − ˜y
(cid:107) 1 ≤ 2 (cid:107) x − y (cid:107) 1 .
Proof.
Let S ⊂ [ n ] be the set of indices i ∈ [ n ] for which x
[ i ] ≥ y
[ i ] ⇐⇒
˜y
[ i ] = (cid:100)
y
[ i ] (cid:101) .
For i ∈ [ n ] \ S we have | x [ i ] − y
[ i ] | ≥ 1 / 2 ≥ | ˜y [ i ] − y
[ i ] | so it follows by the triangle inequality that
[Equation]
Combining this projection with the convex relaxation above and the result of Dinitz et al.
[16] shows that for any predictor x ∈ R n we have (up to afﬁne transformation) a convex upper bound U t ( x )
= (cid:107) x − x ∗ ( c t ) (cid:107) 1 on the runtime of the Hungarian method, as desired.
We now move to step two.
Step 2 - Online learning: The second component of our approach is natural: once one has an upper bound on the cost, apply standard online learning algorithms and results to these upper bounds to obtain guarantees for learning predictions. In online learning, the aim is to play actions x 1 , . . .
, x T s.t. their regret (cid:80) Tt =1 U t ( x t ) − min x U t ( x ) on a sequence of adversarially chosen losses U t is sublinear . For bipartite matching, we can just apply regular projected online gradient descent (OGD) to losses
U t ( x ) = (cid:107) x − x ∗ ( c t ) (cid:107) 1 ; as shown in Theorem 3.1, this yields sublinear regret via a textbook result.
The simplicity here is the point; by relegating as much of the difﬁculty as we can to obtaining an easyto-optimize upper bound in step one, we make the actual learning-theoretic component easy.
However, as we show in the following sections, it is not always easy to obtain a suitable upper bound, nor is it always obvious what online learning algorithm to apply, e.g. if the upper bounds are non-convex.
Our use of online learning for this step is motivated by two factors: (1) being able to do well on non-i.i.d.
instances is important in practical applications, e.g. in job scheduling problems where demand for computational resources is constantly changing over time, and (2) the existence of classic online-to-batch procedures for converting regret into sample complexity guarantees [12], i.e. bounds on the number of samples needed to obtain an ε -suboptimal predictor w.p. ≥ 1 − δ .
While online-tobatch conversion can be suboptimal [20], as we show in Theorems 3.1, B.2, and D.1 its application to various graph algorithms with predictions problems improves upon existing sample complexity results. For completeness, we formalize online-to-batch conversion as Lemma A.1 in the Appendix.
We now show how this second online learning step is implemented for the bipartite matching problem by improving upon the result of Dinitz et al.
[16] in Theorem 3.1 below; the speciﬁc improvement is in the entirely new regret guarantee against adversarial cost vectors and a ˜ O ( n ) improvement in the sample complexity.
Note how the proof requires only their existing algorithmic contribution, Claim 3.1, and some standard tools in online convex optimization.
Theorem 3.1.
Suppose we have a ﬁxed bipartite graph with n ≥ 3 vertices and m ≥ 1 edges.
For any cost vector c ∈ Z m ≥ 0 and any dual vector x ∈ R n there exists an algorithm for MWPM that runs in time
[Equation]
for U ( x ) = (cid:107) x − x ∗ ( c ) (cid:107) 1 , where x ∗ ( c ) the optimal dual vector associated with c . 2.
There exists a poly-time algorithm s.t. for any δ, ε > 0 and distribution D over integer m -vectors with (cid:96) ∞ -norm ≤ C it takes O (cid:16)(cid:0) Cnε (cid:1) [Table] D
[Table]
[Equation]
[Table] [Equation] [Table] [Equation]
[Table]
[Equation]
[Table] [Equation] [Table] [Equation]
[Table]
Let c 1 , . .
c T ∈
Z m ≥ 0 be an adversarial sequence of m -vectors with (cid:96) ∞ -norm ≤ C .
There exists an efﬁcient algorithm that predicts x t after seeing c 1 , . . .
, c t − 1 and achieves regret
[Equation]
Proof.
The ﬁrst result follows by combining Dinitz et al.
[16, Theorem 13] with Claim 3.1.
For the third result, let x t be the sequence generated by running OGD [46] with step size C/ √ 2 T on the losses
U t ( x ) = (cid:107) x − x ∗ ( c t ) (cid:107) 1 over domain [ − C, C ] n .
Since these losses are √ n -Lipschitz and the duals are C √ n -bounded in Euclidean norm the regret guarantee follows from Shalev-Shwartz [44, Corollary 2.7].
For the second result, we apply standard online-to-batch conversion to the third result, i.e. we draw T = Ω (cid:16)(cid:0) Cnε (cid:1) 2 log 1 δ (cid:17) samples c t , run OGD as above on the resulting losses U t , and set ˆx = 1 T (cid:80)
Tt =1 x t to be the average of the resulting predictions x t .
The result follows by Lemma A.1.
This concludes an overview of our two-step approach for obtaining learning guarantees for algorithms with predictions.
To summarize, we propose to (1) obtain simple-to-optimize upper bounds U t ( x ) on the cost of the target algorithm on instance t as a function of prediction x and (2) optimize U t ( x ) using online learning.
While conceptually simple, even in this illustrative example it already improves upon past work; in the sequel we demonstrate further results that this approach makes possible.
Note that, like Dinitz et al.
[16], we are also able to generalize Theorem 3.1 to b -matchings, which we do in Appendix B; another advantage of our approach is that it lets us prove online and statistical learning in the case where the demand vector b varies across instances rather than staying ﬁxed as in Dinitz et al. Finally, in Appendix D we also improve upon the more recent learning-theoretic results of Chen et al. [13] for related graph algorithms with predictions problems.
Predicting requests for page migration
Equipped with our two-step approach for deriving guarantees for learning predictors, we investigate several more important problems in combinatorial optimization, starting with the page migration problem.
Our results demonstrate that even for learning such simple predictors there are interesting technical challenges in deriving a learnable upper bound.
Nevertheless, once this is accomplished the second step of our approach is again straightforward.
Page migration: Consider a server that sees a sequence of requests s [1] , . . .
, s [ n ] from metric space ( K , d ) and at each timestep decides whether to change its state a [ i ] ∈ K at cost Dd ( a [ i − 1] , a [ i ] ) for some D > 1 ; it then suffers a further cost d ( a [ i ] , s [ i ] ) .
The online page migration (OPM) problem is then to minimize the cost to the server.
Recently, Indyk et al.
[22] studied a setting where we are given a sequence of predicted points ˆ s [1] , . .
, ˆ s [ n ] ∈ K to aid the page migration algorithm.
They show that if there exists γ, q ∈ (0 , 1) s.t. γD ∈ [ n ] and for any i ∈ [ n ] we have (cid:80) i + γD − 1 j = i
[Equation]
then there exists an algorithm with competitive ratio (1 + γ )(1 + O ( q )) w.r.t.
to the ofﬂine optimal.
This algorithm depends on γ but not q , so we study the setting where γ is ﬁxed.
Deriving an upper bound: As in the previous section, the predictions are discrete, so to use our approach we must convert it into a continuous problem.
As we have ﬁxed γ , the competitive ratio is an afﬁne function of the following upper bound on q :
[Equation]
We assume that the set of points K is ﬁnite with indexing k = 1 , . . .
, |K| and use this to introduce our continuous relaxation, a natural randomized approach converting the problem of learning a prediction into n experts problems on |K| experts.
For each j ∈ [ n ] we deﬁne a probability vector p [ j ] ∈ (cid:52) |K| governing the categorical r.v.
ˆ s [ j ] , i.e. Pr { ˆ s [ j ] = k } = p [ j,k ] ∀ k ∈ K .
Under these distributions the expected competitive ratio will be (1 + γ )(1 + O ( E ˆ s ∼ p Q
(ˆ s, s ))) , for p the product distribution of the vectors p j .
Note that forcing each p j to be a one-hot vector recovers the original approach with no loss, so optimizing E ˆ s ∼ p Q
(ˆ s, s ) over p ∈ (cid:52) n |K| would ﬁnd a predictor that ﬁts the original result.
However, E ˆ s ∼ p Q (ˆ s, s ) is not convex in p .
The simplest relaxation is to replace the maximum by summation, but this leads to a worst-case bound of O (cid:16) nγD (cid:17) .
We instead bound E ˆ s ∼ p Q
(ˆ s, s ) —and thus also the expected competitive ratio—by a function of the following maximum over expectations:
[Equation]
where s [ j,k ] = 1 s [ j ] = k ∀ k ∈ K , i.e. s [ j ] encodes the location in K of the j th request.
As a maximum over n − γD + 1 convex functions this objective is also convex.
Note also that if U s ( p ) is zero—i.e. the probability vectors are one-hot and perfect—then E ˆ s ∼ p Q (ˆ s, s ) ≥ q will also be zero.
In fact, q is upper-bounded by a monotonically increasing function of U s ( p ) that is zero at the origin, but as this function is concave and non-Lipschitz (c.f. Figure 1) we incur an additive O (cid:16) [Equation] [Equation] γD (cid:17) loss to obtain an online-learnable upper bound.
This is formalized in the following result (proof in A.1).
Lemma 4.1.
There exist constants a < e, b < 2 /e
and a monotonically increasing function f : [0 , ∞ ) (cid:55)→ [0 , ∞ )
s.t. f (0)
=
and
[Equation]
We now have an convex bound on the competitive ratio for the OPM algorithm of Indyk et al.
For both this and bipartite matching we resorted to a relaxation of a discrete problem.
However, whereas before we only incurred a multiplicative loss (c.f. Claim 3.1), here we have an additive loss that makes the bound meaningful only for γD (cid:29) log n .
However, as the method we propose optimizes U s ( p ) , which bounds q with no additive error via the function f in Lemma 4.1, in-practice we may expect it to help minimize q in all regimes.
Note that the non-Lipschitzness near zero that prevents using f for formal regret guarantees comes from the poor tail behavior of Poisson-like random variables with small means, which we do not expect can be signiﬁcantly improved.
Learning guarantees: Having established an upper bound, in Theorem 4.2 we again show how a learning-theoretic result follows from standard online learning.
This time, instead of OGD we run the exponentiated gradient (EG) method [44], a classic approach to learning from experts, on each of the n simplices to learn the probability vectors p
[ j ] .
EG performs updates by multiplying by the negative gradient and is notable for having regret logarithmic in the size |K| of the simplices, which is important if the metric space is large.
Note that as the relaxation is randomized, our algorithms output a dense probability vector; to obtain a prediction for OPM we must sample ˆ s t [ j ] ∼ p [ j ] ∀ j ∈ [ n ] .
Theorem 4.2.
Let ( K , d ) be a ﬁnite metric space.
For any request sequence s and any set of probability vectors p ∈ (cid:52) n |K| there exists an algorithm for OPM with expected competitive ratio
[Equation]
There exits a poly-time algorithm s t. for any δ, ε > 0 and distribution D over request sequences s ∈ K n it takes O (cid:18)(cid:16) γDε (cid:17)
n 2 log K + log samples from D and returns ˆp s.t.
.p.
≥
− δ
[Equation]
Let s 1 , . . .
, s T be an adversarial sequence of request sequences.
There exists an efﬁcient algorithms that plays p t after seeing s 1 , . . .
, s t − 1 and has regret
[Equation]
Proof.
The ﬁrst result follows by combining Indyk et al.
[22, Theorem 1] with Lemma 4.1.
For the third let p t be generated by running n exponentiated gradient algorithms with step-size (cid:113) log |K| 2 γ 2 D 2 T on losses U s t ( p ) over (cid:52) n |K| .
Since these are γD -Lipschitz and the maximum entropy is log |K| , the regret follows by [44, Theorem 2.15].
For the second result, apply standard online-to-batch conversion to the third, i.e. draw T = Ω (cid:18)(cid:16) γDε (cid:17) 2 (cid:0) n 2 log |K| + log 1 δ (cid:1)(cid:19)
samples s t , run EG on U s t ( p ) as above, and set ˆp = 1 T (cid:80)
Tt =1 p t to be the average of the resulting actions.
The result follows by Lemma A.1.
As before, this result ﬁrst shows how the quantity of interest—in this case the competitive ratio—is upper-bounded by an afﬁne function of some measure U s ( p ) , for which we then provide regret and statistical guarantees using online learning.
The difﬁculty deriving a suitable upper bound exempliﬁes the technical challenges that arise in learning predictors, difﬁculties that may be encountered again in other sequence prediction problems such as TCP [10].
Nevertheless, our approach does yield an online procedure that incurs only O ( log n γD ) additive error over Indyk et al.
[22] in the case of a perfect predictor and, unlike their work, we provide an algorithm for learning the predictor itself.
Learning linear predictors with instance-feature inputs
So far we have considered only ﬁxed predictors, either optima-in-hindsight in the online setting or a population risk minimizers for i.i.d.
data. Actual instances can vary signiﬁcantly and so a ﬁxed predictor may not be very good, e.g. in the example of querying a sorted array it means always returning the same index. In the online setting one can consider methods that adapt to dynamic comparators [46, 23, 37], which are also applicable to our upper bounds; however, these still need measures such as the comparator path-length to be small, which may be more reasonable in some cases but not all. We instead study the setting where all instances come with instance-speciﬁc features; this is a natural and practical assumption [27, 30] that encompasses numerical representations of the instance itself— e.g. bits representing a query or a graph—or other information such as weather or day of the week.
These are passed to functions—e.g. linear predictors, neural nets, or trees—whose parameters can be learned from data.
We study linear predictors, which are often amenable to similar analyses as above since the composition of a convex and afﬁne function is convex.
For example, it is straightforward to extend the matching results to bound the regret and sample complexity of learning a linear predictor of duals.
Page migration is more challenging because the outputs must lie in the simplex, which we solve by restricting to matrices with columns in the simplex, i.e. rectangular stochastic matrices.
Both sets of results are shown in Appendix C.
Notably, for page migration our guarantees cover the auto-regressive setting where the server probabilities are determined by a ﬁxed linear transform of past states.
Our main example will instead be online job scheduling via minimizing the fractional makespan, following Lattanzi et al.
They consider the problem of assigning each in a sequence of variablesized jobs to one of m machines [30, Section 3].
The authors provide an algorithm that uses predictions ˆw ∈ R m> 0 of “good" machine weights w ∈ R m> 0 to assign jobs based on how well ˆw corresponds to machine demand; the algorithm has a runtime guarantee of O (cid:0) log min { max i ˆw
[ i ] / w [ i ] , m } (cid:1) .
They also discus learning linear and more complicated predictors, but without guarantees.
In this section we provide guarantees for the linear prediction setting in which we target the logarithm of the machine weights, which makes the problem convex.
Note we assume features lie in the f -dimensional simplex, and for simplicity we only consider learning the linear transform from features to predictors and not the intercept, as the latter is subsumed by the former.
For the online result, we use the parameter-free algorithm of Orabona and Pal [38], which allows us to not assume any bound on the machine weights and thus compete with the optimal linear predictor in all of R m × f .
Theorem 5.1.
Consider online restricted assignment with m ≥ 1 machines [30, Section 2.1].
For predicted logits x ∈
R m there is an algorithm whose fractional makespan has competitive
ratio
[Equation]
for U ( x ) = (cid:107) x − log w (cid:107) ∞ , where w ∈ R m> 0 are good machine weights [30, Section
There exists a poly-time algorithm s
t. for any δ, ε > 0 and distribution D over machine (weight, feature) pairs ( w , f
) ∈ R m> 0 × (cid:52) f s.t.
[Equation]
log w (cid:107)
∞
≤ B
the
algorithm takes
O (cid:16)(cid:0) Bε (cid:1)
(cid:0) mf + log 1 δ (cid:1)(cid:17)
samples from D and returns ˆA
∈ R m ×
[Equation]
p.
[Equation]
+ ε 3.
Let ( w 1 , f 1 ) , . . .
, ( w T , f T ) ∈ R m> 0 × (cid:52) f be an adversarial sequence of (weights, feature) pairs.
There exists an efﬁcient algorithm that plays A t after seeing ( w 1 , f 1 ) , . . .
, ( w t − 1 , f t − 1 ) with regret
T (cid:88) t
[Equation]
w.r.t.
any A ∈ R m × f .
For bounded matrices there exists an efﬁcient algorithm with regret
[Equation]
Proof.
The ﬁrst result follows by substituting max i exp( x [ i ] ) /
w [ i ] for η in Lattanzi et al.
[30, Theorem 3.1] and upper bounding the maximum by the (cid:96) ∞ -norm.
For the third result let A t be the sequence generated by running the KT-OCO algorithm Orabona and Pal [38, Algorithm 1] using ε = 1 and the gradients of (cid:107)
A t f t − log w t (cid:107) ∞ as reward vectors; the regret follows from Orabona and Pal [38, Corollary 5] and the fact that U t is 1-Lipschitz w.r.t.
the Euclidean norm.
The case of competing with B -bounded A follows by applying projected online gradient descent (OGD) over (cid:107) A (cid:107) max ≤ B with step-size B (cid:113) mf 2 T [44, Corollary 2.7].
Finally, the second result follows by applying online-to-batch conversion to the latter result, i.e. draw T = Ω (cid:16)(cid:0) Bε (cid:1) 2 (cid:0) mf + log 1 δ (cid:1)(cid:17) samples ( w t , f t ) , run OGD on the resulting losses (cid:107)
{+Af t − log w t (cid:107) ∞ as above, and set ˆ A = 1 T (cid:80) T t =
+}
A t to be the average of the resulting actions A t .
The result follows by Lemma A.1.
This guarantee is the ﬁrst we are aware of for learning non-static predictors in the algorithms with predictions literature.
It demonstrates both how to extend ﬁxed predictor results to learning linear predictors—note that the former is recovered by having f t = 1 1 ∀ t —and how to handle unbounded predictor domains.
The ability to provide such guarantees is another advantage of our approach.
Tuning robustness-consistency trade-offs for scheduling and ski-rental
We turn to tuning robustness-consistency trade-offs, introduced in Lykouris and Vassilvitskii [34].
This trade-off captures the tension between following the predictions when they are good (consistency) and doing not much worse than the worst-case guarantee in either case (robustness).
In many cases, this trade-off can be made explicit, by a parameter λ ∈ [0 , 1] .
The setting of λ is crucial, yet previous work left the decision to the end-user.
Here we show that it is often eminently learnable in an online setting.
We then demonstrate how to accomplish a much harder task—tuning λ at the same time as learning to predict—on two related but technically very different variants of the ski-rental problem.
This meta-application highlights the applicability of our approach to non-convex upper bounds.
Robustness-consistency trade-offs: Most problems studied in online algorithms with predictions usually have existing worst-case guarantees on the competitive ratio, i.e. a constant γ ≥ 1 on how much worse (multiplicatively) a learning-free algorithm does relative to the ofﬂine optimal cost OPT t on instance t .
While the goal of algorithms with predictions is to use data to do better than this worst-case bound, an imperfect prediction may lead to much worse performance.
As a result, most guarantees strive to upper bound the cost of an algorithm with prediction x on an instance t as follows:
[Equation]
Here u t is some measure of the quality of x on instance t , λ ∈ [0 , 1] is a parameter, f is a monotonically increasing function that ideally satisﬁes f (0)
= 1 , and g t is a monotonically decreasing function that ideally satisﬁes g t (1)
=
γ OPT t .
A very common structure is f ( λ )
= 1 / (1 − λ ) and g t ( λ ) = γλ OPT t .
For example, consider job scheduling with predictions, a setting where we are given n jobs and their predicted runtimes with total absolute error η and must minimize the sum of their completion times when running on a single server with pre-emption.
Here Kumar et al. [29, Theorem 3.3] showed that a preferential round-robin algorithm has competitive ratio at most min (cid:110)
+2 η/n 1 − λ , 2 λ (cid:111) .
Thus if we know the prediction is perfect we can set λ = 0 and obtain the optimal cost (consistency); on the other hand, if we know the prediction is poor we can set λ =and get the (tight) worst-case guarantee of two (robustness).
Of course in-practice we often do not know how good a prediction is on a speciﬁc instance t ; we thus would like to learn to set λ , i.e. to learn how trustworthy our prediction is.
As a ﬁrst step, we can consider doing so when we are given a prediction for each instance and thus only need to optimize over λ .
For example, the just-discussed problem of job scheduling has competitive ratio upper-bounded by U t ( λ )
=
min (cid:110) [-
 +2-]1+2 η t /n t 1 − λ , 2 λ (cid:111) for n t and η t the number of jobs and the prediction quality, respectively, on instance t .
Assuming a bound B on the average prediction error, we can show that U t is Lipschitz on [0 , 1] and apply the continuous Hedge algorithm of Krichene et al.
[28]—an expert algorithm for inﬁnite experts—to get a regret guarantee (proof in A.2):
Corollary 6.1.
For the competitive ratio upper bounds U t of the job scheduling problem with average prediction error η/n t at most B there exists an algorithm with expected regret
[Equation]
where the expectation is over the randomness of the algorithm.
Thus a standard learning method produces a sequence λ t that performs as well as the best λ asymptotically.
We next consider the more difﬁcult problem of simultaneously tuning λ learning to predict.
Ski-rental: We instantiate this challenge on ski-rental, in which each task t is a ski season with an unknown number of days n t ∈ Z ≥ 2 ; to ski each day, we must either buy skis at price b t or rent each day for the price of one.
The optimal ofﬂine behavior is to buy iff b t < n t , and the best algorithm has worst-case competitive ratio e/ ( e − 1) .
Kumar et al.
[29] and Bamas et al.
[10, Theorem 2] further derive an algorithm with the following robustness-consistency trade-off between blindly following a prediction x and incurring cost u t ( x ) =
b t 1 x>b t + n t 1 x ≤ b t or going with the worst-case guarantee:
[Equation]
Assuming a bound N ≥ 2 on the number of days and B > 0 on the buy price we can show that U t is bounded and Lipschitz w.r.t.
λ .
We can thus run randomized exponentiated gradient over the product set [ N ] × { δ/ 2 , . .
, 1 − δ/ 2 } on the functions U t ( · , x t ) for some δ s.t.
/δ ∈
Z ≥ 2 to get a bound on the expected regret (proof in A.3).
Corollary 6.2.
For the competitive ratio upper bounds U t of the discrete ski-rental problem there exists an online algorithm with expected regret
[Equation]
Thus via an appropriate discretization the sequence of predictions ( x t , λ t ) does as well as the joint optimum on this problem.
However, we can also look at a case where we are not able to just discretize to get low regret.
In particular, we consider the continuous ski-rental problem, where each day n t > 1 is a real number, and study how to pick thresholds x after which to buy skis, which has cost u t ( x ) = n t 1 n t ≤ x + ( b t + x )1 n t >x .
Note that x = 0 and x = N recovers the previous setting where our decision was to buy or not at the beginning.
For this setting, Diakonikolas et al.
[15] adapt an algorithm of Mahdian et al.
[35] to bound the cost as follows:
[Equation]
While the bound is simpler as a function of λ , it is discontinuous in x because u t is piecewiseLipschitz.
Since one cannot even attain sublinear regret on adversarially chosen threshold functions, we must make an assumption on the data.
In particular, we will assume the days are dispersed :
Deﬁnition 6.3.
A set of (possibly random) points n 1 , . .
. , n T ∈ R are β -dispersed if ∀ ε ≥ T − β the expected number in any ε -ball is ˜ O ( εT ) , i.e. E max x ∈ [0 ,N ] | [ x ± ε ] ∩ { n 1 , . . .
, n T }| =
˜ O ( εT ) .
Dispersion encodes the stipulation that the days, and thus the discontinuities of u t ( x, λ ) , are not too concentrated.
In the i.i.d.
setting, a simple condition that leads to dispersion with β = 1 / 2 is the assumption that the points are drawn from a κ -bounded distribution [6, Lemma 1].
Notably this is a strictly weaker assumption than the log-concave requirement of Diakonikolas et al.
[15] that they used to show statistical learning results for ski-rental.
Having stipulated that the ski-days are β -dispersed, we can show that it implies dispersion of the loss functions [6] and thus obtain the following guarantee for the exponentially weighted forecaster [6, 9] applied to U t ( x, λ ) (proof in A.4):
Corollary 6.4.
For cost upper bounds U t of the continuous ski-rental problem there exists an online algorithm with expected regret
[Equation]
Thus in two mathematically quite different settings of ski-rental we can directly apply online learning to existing bounds to not only learn online the best action for ski-rental, but to at the same time learn how trustworthy the best action is via tuning the robustness-consistency trade-off.
Conclusion and future work
The ﬁeld of algorithms with predictions has been successful in circumventing worst case lower bounds and showing how simple predictions can improve algorithm performance.
However, except for a few problem-speciﬁc approaches, the question of how to predict has largely been missing from the discussion.
In this work we presented the ﬁrst general framework for efﬁciently learning useful predictions and applied it to a diverse set of previously studied problems, giving the ﬁrst low regret learning algorithms, reducing sample complexity bounds, and showing how to learn the best consistency-robustness trade-off.
One current limitation is the lack of more general-case guarantees for simultaneously tuning robustness-consistency and learning the predictor, which we only show for ski-rental.
There are also several other avenues for future work.
The ﬁrst is to build on our results and provide learning guarantees for other problems where the algorithmic question of how to use predictions is already addressed.
Another is to try to improve known bounds by solving the problems holistically: developing easy-to-learn parameters in concert with developing algorithms that can use them.
Finally, there is the direction of identifying hard problems: what are the instances where no reasonable prediction can help improve an algorithm’s performance?
Acknowledgments
We thank Yilin Yan, Alexander Smola, Shinsaku Sakaue, and Taihei Oki for helpful discussion.
This material is based on work supported in part by the National Science Foundation under grants
CCF-1535967, CCF-1910321, IIS-1618714, IIS-1705121, IIS-1838017, IIS-1901403, IIS-2046613, and SES-1919453; the Defense Advanced Research Projects Agency under cooperative agreements
HR00112020003 and FA875017C0141; a Simons Investigator Award; an AWS Machine Learning
Research Award; an Amazon Research Award; a Bloomberg Research Grant; a Microsoft Research
Faculty Fellowship; an Amazon Web Services Award; a Facebook Faculty Research Award; funding from Booz Allen Hamilton Inc.; a Block Center Grant; and a Facebook PhD Fellowship.
Any opinions, ﬁndings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reﬂect the views of any of these funding agencies.
A Proofs of main results A.1 Proof of Lemma 4.
Proof.
For each j ∈ [ n ] deﬁne p
j = 1 − (cid:104) s
[ j ] , p [ j ] (cid:105) , i.e. the probability that ˆ s j (cid:54) =
s j , and the r.v.
X j ∼ Ber
( p j ) .
Deﬁne also the r.v. S
i
=
(cid:80) i + γD − 1 j = i
[Equation]
j , s.t.
we have
[Equation]
Note that S
i is a Poisson binomial and so has moment-generating function E
p exp( tS i ) =
(cid:81)
i + γD −j =
i (1 − p j + p j e t ) .
Therefore applying Jensen’s inequality and the union bound yields exp (cid:18)
[Equation]
j =
[Equation]
p
[Equation]
for all t >
and i ∗ ∈ arg max i ∈ [ n − γD
+
E p S i .
We then have t E p max i ∈ [ n − γD +
] S i ≤ log( n − γD + 1) + i ∗ + γD − 1 (cid:88)
j = i ∗ log(1 − p j + p j e t ) ≤ log( n − γD + 1)
[Equation]
Dividing by t = W (cid:16) log( n − γD +1) x (cid:17) + 1 shows that f ( x ) =
x (exp( t ) − 1)+log( n − γD +1) tγD , where W : [0 , ∞ ) (cid:55)→ [0 , ∞ ) is the Lambert W -function.
Deﬁne L = log( n − γD
+ 1) /e , so we are interested in bounding f
( x ) = x (exp( W ( L/x )+1) − 1)+ eL W
( L/x )+ .
We compute its derivative:
[Equation]
and second derivative:
[Equation]
Since the second derivative is always negative, f is a concave function on x ≥ 0 .
Thus for ω = W (1) we have
[Equation]
2 eL L ( ω + 1)( x − L ) = (cid:0) e/ω + 1 / ( ω + 1) 3 − ( e + 1) / ( ω + 1) − 1 / ( ω + 1) 2 (cid:1) x + (cid:0) 1 / ( ω + 1) 2 + e/ ( ω + 1) − 1 / ( ω + 1) 3 (cid:1) L < ex + 2 e log( n − γD + 1)
A.2 Proof of Corollary 6.
Proof.
We have that U t ( λ ) is bounded above by 3(1 + 2 B ) , its largest gradient is attained at 2 / (3 + 2 η t /n ) where it is bounded by (3 + 2 B ) / 2 .
Applying Krichene et al.
[28, Corollary 2] and simplifying yields the result.
A.3 Proof of Corollary 6.
Proof.
U t ( x, λ ) is bounded above by 2 N and its largest gradient is attained at λ = min { b t ,n t } u t ( x ) ≥ 1 N with norm bounded by B exp(1 /N )
(exp(1 /N )
− 1) 2 .
Let Λ = { kδ } (cid:98)
/δ
(cid:99) k
=1 for some δ ∈ (0 , 1] .
Then we run EG on the simplex over [ N ] × Λ and with step-size 12 N (cid:113) log Nδ 2 T to obtain regret compared to the best element of [ N ] × Λ of 2 N (cid:113) 2 T log
Nδ [44, Theorem 2.15].
Setting δ = min (cid:110) N (exp(1 /N ) − 1) 2 B exp(1 /N )
(cid:113) 2 T , 1 (cid:111) yields
E T (cid:88) t =
[Equation]
1 N −
[Equation]
log (cid:18) exp (cid:18)
N (cid:19) −(cid:19)(cid:27)(cid:19)
+
[Equation]
min x ∈ [ N ]
[Equation]
T (cid:88) t =
U t ( x, λ ) ≤
[Equation]
N (cid:112) [Equation] log( BNT ) + min x ∈ [ N ] ,λ
[Equation]
T (cid:88) t =
U t ( x, λ )
A.4 Proof of Corollary 6.
Proof.
U t ( x, λ ) is bounded above by e ( N + B ) , its largest gradient w.r.t.
λ is attained at λ =
e min { n t ,b t } ( e − 1) u t ( x )+ e min { n t ,b t } , where it is bounded by (cid:16) 2 e ( N + B ) e −(cid:17) 2 , and its largest gradient w.r.t.
x is e ( N +
B ) .
Thus the function is 5 e ( N + B ) 2 -Lipschitz w.r.t.
the Euclidean norm, apart from discontinuities at x = n t .
Now, note that our assumption that the points n 1 , . .
, n T are β -dispersed implies exactly that the functions U t are β -dispersed
(c.f.
Balcan et al.
[9, Deﬁnition 2.1]), so the exponentially-weighted forecaster attains expected regret ˜ O
(cid:16)(cid:112) T log( NT )
+ ( N + B ) 2 T 1 − β (cid:17) .
A.5 Online-to-batch conversion
Lemma A.1.
Suppose an online learner has regret bound R T on a sequence of convex losses (cid:96) y 1 , . . .
, (cid:96) y T : X (cid:55)→ [0 , B ] whose data y t are drawn i.i.d. from some distribution D . If x 1 , . . , x T are the actions of the online learner, ˆx = 1 T (cid:80)
Tt =1 x t is their average, and T = Ω (cid:16) T ε + B 2 ε 2 log 1 δ (cid:17) for T ε =
min 2 R T (cid:48) ≤ εT (cid:48) T (cid:48) , then w.p. ≥ 1 − δ we have E y ∼D (cid:96) y ( ˆx ) ≤ min x ∈X E y ∼D (cid:96) y ( x ) + ε .
Proof. Apply Jensen’s inequality, [12, Proposition 1], the regret bound, and Hoeffding’s bound: [Equation] B b -matching
Deﬁnition B.1.
For b ∈ R n ≥
the b -seminorm (cid:107) · (cid:107) b , 1 : R n (cid:55)→ R ≥ 0 is (cid:107) x (cid:107) b , 1 = (cid:80) ni
=1 b [ i ] | x [ i ] | .
Claim B.1.
Given any vectors x ∈ Z n and y ∈ R n , let ˜y ∈
Z n be the vector whose elements are those of y rounded to the nearest integer.
Then for all b ∈ Z n we have (cid:107) x − ˜y (cid:107) b , 1 ≤ 2 (cid:107) x − y (cid:107) b , 1 .
Proof.
Let S ⊂ [ n ] be the set of indices i ∈ [ n ] for which x
[ i ] ≥ y
[ i ] ⇐⇒
˜y
[ i ] = (cid:100)
y
[ i ] (cid:101) .
For i ∈ [ n ] \ S we have | x [ i ] − y
[ i ] | ≥ 1 / 2 ≥ | ˜y [ i ] − y
[ i ] | so it follows by the triangle inequality that
[Equation]
Theorem B.2.
Suppose we have a ﬁxed graph with n ≥ 3 vertices and m ≥ 1 edges
For any cost vector c ∈ Z m ≥ 0 , any demand vector b ∈ Z n ≥ 0 , and any dual vector x ∈ R n there exists an algorithm for minimum weight perfect b -matching that runs in time ˜ O ( mnU ( x )) , where U ( x ) = (cid:107) x − x ∗ ( c , b ) (cid:107) b , 1 for x ∗ ( c , b ) the optimal dual vector associated with c and b . 2. There exists a poly-time algorithm s.t.
for any δ, ε > 0 and any distribution D over (cost, demand) vector pairs in Z m ≥
× Z n ≥ 0 with respective (cid:96) ∞ -norms bounded by C and B the algorithm takes O (cid:16)(cid:0) CBnε
[Equation]
log 1 δ (cid:17) samples from D and returns ˆx s.t. w.p. ≥ 1 − δ :
[Equation]
Let ( c 1 , b 1 ) , . . .
, ( c T , b T ) ∈
Z m ≥
× Z n ≥ 0 be an adversarial sequence of (cost, demand) vector pairs with (cid:96) ∞ -norms bounded by C and B , respectively.
There exists an efﬁcient algorithm that predicts x t after seeing ( c 1 , b 1 ) , . . .
, ( c t − 1 , b t − 1 ) and achieves regret
[Equation]
Proof.
The ﬁrst result follows by Dinitz et al.
[16, Theorem 31] and Claim B.1.
For the third, let x t be the sequence generated by running OGD [46] with step size C B √ 2 T on the losses
U t ( x ) = (cid:107) x − x ∗ ( c t , b t ) (cid:107) b t , 1 over domain [ − C, C ] n .
Since these losses are B √ n -Lipschitz and the duals are C √ n -bounded in Euclidean norm the regret guarantee follows from Shalev-Shwartz [44, Corollary 2.7].
For the second result, apply online-to-batch conversion to the third result, i.e. draw T = Ω (cid:16)(cid:0) CBnε (cid:1) 2 log 1 δ (cid:17) samples ( c t , b t ) , run OGD as above on the resulting losses U t , and set ˆx = 1 T (cid:80)
Tt =1 x t to be the average of the resulting predictions x t .
Applying Lemma A.1 yields the result.
C Learning linear predictors with instance-feature inputs
Computational instances on which we want to run algorithms with predictions often come with instance-speciﬁc features, e.g. ones derived from text descriptions of the instance or summary statistics about related graphs or environments [27, 30].
It is thus natural to learn parameterized functions, e.g. linear mappings or neural networks, from these features to predictions.
However, there has been very little work, in either the statistical or online setting, showing that such predictions are learnable.
In this section we show how our framework naturally handles this setting by exploiting the convexity of compositions of convex and afﬁne functions, resulting in the ﬁrst formal guarantees for linear predictors for algorithms with predictions.
While the ﬁrst application to the matching problem of Dinitz et al.
[16] is a straightforward extension, we also show how to handle more complicated cases, such as when the output space is constrained to probability simplices as in the page migration problem.
Note we assume all feature vectors lie in the f -dimensional simplex; this is generally easy to accomplish by normalization.
For simplicity we also only consider learning the linear transform from features to predictors and not the intercept, as the latter follows from the former by appending an extra dimension with value 1 / 2 to the feature vector and doubling the bound on the norm of the linear transform.
C.1 b -matching
Our ﬁrst application for learning mappings from instance features is to the b -matching setting.
Note that the learning-theoretic results for the regular bipartite matching setting in Section 3 follow directly by setting b = 1 n for all instances, and that the learning-theoretic results of Theorems 3.1 and B. are also special cases of the following when f = 1 1 for all instances.
Note that we optimize only over A ∈ [ − C, C ] n × f , but unlike in the f = 1 case the optimal A may be unbounded; to handle that setting, one could use an algorithm that does not depend on knowing the set size [38].
Theorem C.1.
Consider the setting of Theorem B.2.
There exists a poly-time algorithm s.t.
for any δ, ε > 0 and any distribution D over (cost, demand, feature) vector triples in Z m ≥
× Z n ≥ 0 × (cid:52) f s.t.
the respective (cid:96) ∞ -norms of the ﬁrst two are bounded by C and B , respectively, the algorithm takes O (cid:16)(cid:0) CBnε (cid:1) 2 (cid:0) f 2 + log 1 δ (cid:1)(cid:17) samples from D and returns ˆA ∈ R n × f s t. w.p.
≥
− δ
[Equation]
Let ( c 1 , b 1 , f 1 ) , . . .
, ( c T , b T , f T ) ∈
Z m ≥
× Z n ≥ 0 × (cid:52) f be an adversarial sequence of (cost, demand, feature) vector triples s
t. the (cid:96) ∞ -norms of the ﬁrst two are bounded by C and B , respectively.
There exists an efﬁcient algorithm that predicts A t ∈ R n × f after seeing ( c 1 , b 1 , f 1 ) , . . .
, ( c t − 1 , b t − 1 , f t − 1 ) and achieves regret
[Equation]
Proof.
For the second result let A t be generated by running OGD with step-size
C B √ 2 T on the losses U t
( Af ) =
(cid:107)
Af − x ∗ ( c t , b t ) (cid:107) b t , 1 over [ − C, C ] n × f .
Since these are B √ nf -Lipschitz and the duals are C √ nf -bounded in the Euclidean norm, the regret follows from Shalev-Shwartz [44, Corollary 2.7].
For the ﬁrst result, apply online-to-batch conversion to the second result, i.e. draw T = Ω (cid:16)(cid:0) CBnε (cid:1) 2 (cid:0) f 2 + log 1 δ (cid:1)(cid:17) samples ( c t , b t , f t ) , run OGD as above on the resulting losses U t , and set ˆA = 1 T (cid:80)
Tt =
1 A t to be the average of the resulting predictions A t .
Applying Lemma A. yields the result.
C.2 Online page migration
Using instance features for online page migration is more involved because the output space must be constrained to the product of n |K| -dimensional simplices.
However, we can solve this by restricting to tensors consisting of matrices whose columns sum to one, also known as rectangular stochastic matrices.
Note that the learning-theoretic results of Theorem 4.2 are special cases of the following when f = 1 1 for all instances.
Theorem C.2.
In the setting of Theorem 4.2 let S n ×|K|× f be the set of stacks of |K| × f nonnegative matrices whose columns have unit (cid:96) 1 -norm.
There exists a poly-time algorithm s.t for any δ, ε > 0 and distribution D over request sequences s of length n in K and associated feature vectors f ∈ (cid:52) f it takes
O (cid:18)(cid:16) γDε (cid:17) 2 (cid:0) n 2 f 2 log |K| + log 1 δ (cid:1)(cid:19) samples from D and returns ˆA s.t.
w.p [Equation] ≥
[Equation]
− δ
[Equation]
Let ( s 1 , f 1 ) , . . .
, ( s T , f T ) be an adversarial sequence of (request sequence, feature) pairs.
There exists an efﬁcient algorithm that plays A t after seeing ( s 1 , f 1 ) , . . .
, ( s t − 1 , f t − 1 ) and has regret
[Equation]
Proof.
For the second result let A t be the sequence generated by running nf EG algorithms with step size (cid:113) log |K| 2 γ 2 D 2 T on the losses U s t ( Af ) over S n ×|K|× f .
Since these losses are γD -Lipschitz and the maximum entropy over the simplex is log |K| , the regret guarantee follows from [44, Theorem 2.15].
For the ﬁrst result, apply standard online-to-batch conversion to the second result, i.e. draw T = Ω (cid:18)(cid:16) γDε (cid:17) 2 (cid:0) n 2 f 2 log |K| + log 1 δ (cid:1)(cid:19) samples ( s t , f t ) , run EG on the resulting losses U s t ( Af t ) as above, and set ˆA = 1 T (cid:80)
Tt =
1 A t to be the average of the resulting actions A t .
Applying Lemma A. yields the result.
We can further also show a result in the perhaps more-natural setting where the linear predictor A is the same for each element in the sequence, and maps directly from features to the |K| -simplex.
Notably, the linear auto-regressive setting, in which we want a linear map from the past k sequence elements to a probabilistic prediction of the next one, is covered by this result if we allow the features to be k |K| -dimensional concatenations of k one-hot |K| -length vectors.
Theorem C.3.
In the setting of Theorem 4.2 let S a × b be the set of a × b nonnegative matrices whose columns have unit (cid:96) 1 -norm.
There exists a poly-time algorithm s.t. for any δ, ε > 0 and distribution D over request sequences s of length n in
K
and associated feature sequence F T ∈ S f × n it takes O (cid:18)(cid:16) γDε [Equation]
[Equation]
2 f 2 log |K| + log
[Equation]
samples from D and returns ˆA s.t. w.p. ≥ 1 − δ :
[Equation]
Let ( s 1 , F 1 ) , . . .
, ( s T , F T ) be an adversarial sequence of (request sequence, feature sequence) pairs.
There exists an efﬁcient algorithm that plays A t after seeing ( s 1 , F 1 ) , . . .
, ( s t − 1 , F t − 1 ) and has regret
[Equation]
Proof.
For the second result let A t be the sequence generated by running f EG algorithms with step size (cid:113) log |K| 2 γ 2 D 2 T on the losses U s t ( FA T ) over S |K|× f .
Since these losses are γD -Lipschitz and the maximum entropy over the simplex is log |K| , the regret guarantee follows from [44, Theorem 2.15].
For the ﬁrst result, apply standard online-to-batch conversion to the second result, i.e. draw T = Ω (cid:18) (cid:16) γDε (cid:17) 2 (cid:0) f 2 log |K| + log 1 δ (cid:1)(cid:19) samples ( s t , f t ) , run EG on the resulting losses U s t ( F t A T ) as above, and set ˆA = 1 T (cid:80)
Tt =
1 A t to be the average of the resulting actions A t .
Applying Lemma A. yields the result.
D Faster graph algorithms with predictions
In this section we compare to the results of Chen et al.
[13], who analyze several prediction-based graph algorithms, including one with an improved prediction-dependent runtime for the matching approach of Dinitz et al.
[16] and a prediction-dependent bound for single-source shortest path.
From the learnability perspective, they observe two important error metrics in the analysis of graph algorithms with predictions: the (cid:96) 1 -metric of Dinitz et al.
[16] measuring the (cid:96) 1 -norm between the prediction and a ground truth vector such as the dual and the (cid:96) ∞ -metric measuring the (cid:96) ∞ -norm between the same quantities.
In the ﬁrst case their setting and results are equivalent to those of Dinitz et al.
[16], so we improve upon this by a factor of O ( d ) , where d is the dimension of the hint.
To analyze the (cid:96) ∞ case, we start by showing that—as in the (cid:96) 1 case—we can round integer vectors with only a multiplicative factor loss:
Claim D.1.
Given any vectors x ∈ Z n and y ∈ R n , let ˜y ∈
Z n be the vector whose elements are those of y rounded to the nearest integer.
Then we have (cid:107) x − ˜y (cid:107) ∞ ≤ 2 (cid:107) x − y (cid:107) ∞ .
Proof.
Let S ⊂ [ n ] be the set of indices i ∈ [ n ] for which x
[ i ] ≥ y
[ i ] ⇐⇒
˜y
[ i ] = (cid:100)
y
[ i ] (cid:101) .
For i ∈ [ n ] \ S we have | x [ i ] − y
[ i ] | ≥ 1 / 2 ≥ | ˜y [ i ] − y
[ i ] | so it follows by the triangle inequality that
[Equation]
We are thus able to also use online convex optimization in this setting and apply the rounded outputs to graph algorithms.
In particular, we can use regular OGD to improve upon the (cid:96) ∞ -learnability result of Chen et al.
[13] by a factor of O ( d 2 ) , where d is the dimension of the prediction:
Theorem D.1.
Consider any graph algorithm with optimal d -dimensional M -bounded predictions h ( c ) associated with every instance c .
There exists a poly-time algorithm s.t. for any δ, ε > 0 and distribution D over instances it takes O (cid:16)(cid:0)
Mε [Equation]
2 (cid:0) d + log 1 δ (cid:1)(cid:17) samples from D and returns ˆh ∈ R d s. [Equation] [Equation] p.
[Equation]
Let c 1 , . .
c T be an adversarial sequence of instances.
There exists an efﬁcient algorithm that plays h t after seeing c 1 , . . .
, c t − 1 and achieves regret
[Equation]
Proof.
The proof is the same as for the last two results of Theorem 5.
E Permutation predictions for non-clairvoyant scheduling
Finally, we discuss the the applicability of our framework to the results in Lindermayr and Megow [33], who study how to prioritize among n jobs by predicting the best permutation of them under weights w ∈ R n ≥ 0 and processing requirements p ∈ R n ≥
that are only known after completion.
Ignoring robustness-consistency tradeoffs and terms that do not depend on the prediction, they show that in several settings the competitive ratio depends linearly on the following error of an n × n permutation matrix X :
[Equation]
where U ∈ { 0 , 1 } n × n is upper triangular.
The above expression is derived from the third equation in the proof of Theorem 4.1 of Lindermayr and Megow [33] for the case of z = 1 sample; we construct the matrix form to reason about its online learnability.
Naively, a sequence of bounded functions of permutations is computationally inefﬁciently learnable by using randomized EG over the n !
experts corresponding to each permutation:
Theorem E.1.
Consider the setting of Lindermayr and Megow [33] with n jobs with W -bounded weights and P -bounded processing times.
Let P n × n be the set of n × n permutation matrices.
There exists an algorithm that s.t. for any δ, ε > 0 and distribution D over weights and processing requirements it takes O (cid:16)(cid:0)
WPnε (cid:1) 2 (cid:0) n log n + log 1 δ (cid:1)(cid:17) samples from D and returns a discrete distribution ˆx ∈ (cid:52) n ! over P n × n such that
[Equation]
Let ( w 1 , p 1 ) , . . .
, ( w T , p T ) be an adversarial sequence of job (weight, processing requirement) pairs.
There exists an algorithm that plays X t after seeing ( w 1 , p 1 ) , . . . , ( w t − 1 , p t − 1 ) and achieves regret
[Equation]
where the expectation is over the randomness of the algorithm.
Proof.
For the second result let x t ∈ (cid:52) n !
be the sequence generated by running EG with step-size (cid:113) log( n !)
2 T over the n !
experts corresponding to each element of P n × n .
Then the sequence of permutation matrices X t ∼ x t sampled from this distribution satisﬁes the guarantee on the expected regret [44,
Corollary 2.14] since log( n !)
≤ n log n and U w , p is WPn -bounded.
The ﬁrst result follows by applying online-to-batch conversion to this sequence, i.e. we draw T = Ω (cid:16)(cid:0)
WPnε (cid:1) 2 (cid:0) n log n + log 1 δ (cid:1)(cid:17) samples ( w t , p t ) , run randomized EG as above, and set ˆx = 1 T (cid:80) T t =1 x t to be the average of the resulting distributions x t .
Applying Lemma A.1 yields the result.
The sample complexity guarantee resulting from online-to-batch conversion matches that of Lindermayr and Megow [33], except that the output is a distribution over permutation matrices so the error is in expectation over that distribution.
However, randomized EG is incredibly inefﬁcient due to the need to store and sample from a distribution over n !
variables.
Another way of learning over permutation matrices is to run an online learning algorithm over the set of doubly stochastic matrices [21].
When the losses are linear functions of the permutation matrices this is yields efﬁcient low-regret algorithms because each doubly stochastic matrix corresponds to a small convex combination of permutation matrices, i.e. a distribution from which one can sample an action.
However, the losses U w , p are nonlinear and so a different approach is needed.