Augmenting Online Algorithms with ε -Accurate Predictions
Abstract
A growing body of work in learning-augmented online algorithms studies how online algorithms can be improved when given access to ML predictions about the future.
Motivated by ML models that give a confidence parameter for their predictions, we study online algorithms with predictions that are ε -accurate: namely, each prediction is correct with probability (at least) ε , but can be arbitrarily inaccurate with the remaining probability.
We show that even with predictions that are accurate with a small probability and arbitrarily inaccurate otherwise, we can dramatically outperform worst-case bounds for a range of classical online problems including caching, online set cover, and online facility location.
Our main results are an
O (log(1 /ε )) -competitive algorithm for caching, and a simple O (1 /ε )
-competitive algorithm for a large family of covering problems, including set cover, network design, and facility location, with ε -accurate predictions.
Introduction
The study of online algorithms with ML predictions has gained significant traction in the ML and algorithms research communities in recent years.
The basic premise is that by having access to predictions about the future, one can design online algorithms that significantly outperform worst-case bounds.
In practice, ML models producing such predictions often come with a confidence estimate which can be roughly interpreted as a probability ε of the prediction being accurate—we call these ε -accurate predictions.
Thus, it is natural to ask: can we design online algorithms whose performance is a function of the confidence parameter ε of ML predictions?
If ε = 1 and all predictions are correct, we would like the algorithm to approach optimal offline performance ( consistency ).
If ε = 0 , then the predictions have no guarantees and we would like to ensure that the algorithm is not much worse than an online algorithm without predictions ( robustness ).
Between these two extremes, we would like the performance of the algorithm to gracefully degrade with the value of ε .
In this paper, we present online algorithms augmented with ε -accurate predictions for fundamental problems such as caching, online set cover, online facility location, and online network design.
ε -accurate predictions.
We consider ML predictions that are (independently) correct with probability at least ε .
Note that ε represents only a minimum guarantee on the probability of a prediction being accurate; individual predictions are allowed to have higher confidence values.
Moreover, we do not restrict what an incorrect prediction constitutes since this will depend on specific problem settings.
But morally, a correct prediction reveals information about the future while an incorrect prediction does not.
The design of online algorithms augmented with ε -accurate predictions has two main challenges: (i) that information (correct predictions) is provided to the algorithm at a slow rate , about once every 1 /ε steps, and (ii) the algorithm needs to disambiguate information (correct predictions) from noise (incorrect predictions) .
We emphasize that we are interested in the “high noise” regime, i.e., small values of ε , where for every correct prediction, there are many incorrect ones.
We will show that even in this regime, we can obtain online algorithms that are substantially better than the worst case.
We also do not assume that the value of ε is known to the online algorithm; rather, our algorithms automatically adapt to the (unknown) value of ε in the underlying prediction model.
In some cases, however, it will be easier to describe the algorithm and analysis if we assume that ε is known.
If that is the case, we will first present the simpler algorithm that knows ε and then generalize it to the one that does not know ε .
Prediction error vs ε -accurate predictions.
The trend in the online algorithms with predictions literature has been to use prediction error rather than prediction confidence to parameterize the performance of online algorithms.
Note the difference in the two measures of prediction quality: an ML model with high confidence (i.e., that produces ε -accurate predictions for ε close to 1) can occasionally make highly inaccurate predictions and therefore have very high prediction error; conversely, an ML model that has a small but consistent bias can have ε =
but still have small prediction error.
So, the results obtained in this paper are complementary (and incomparable) to the existing literature on online algorithms parameterized by prediction error.
To the best of our knowledge, neither caching nor covering problems have been studied in the setting of ε -accurate predictions.
Prior to our work, variants of ε -accurate predictions that also model confidence estimates of predictions have been studied in a few different problem settings such as frequency estimation in data streams [13], k -means [11], secretary problems [10], and page migration [14].
In some cases such as for ski rental [23] and set cover [6], the confidence parameter λ does not represent a measure of correctness of the prediction, rather it is simply a hyperparameter that can be used to trade off the consistency and robustness bounds of the algorithm.
In contrast to these, the goal in this paper is to understand the role of ε -accurate predictions in two central problem domains in online algorithms – caching and online covering problems.
Competitive ratio.
As in previous literature in this area, we also use the classical performance metric of competitive ratio for online algorithms.
The competitive ratio of an online algorithm is the worst-case ratio between the (expected) value of the objective in the algorithm’s solution to that of the (offline) optimum across all input instances.
In the ε -accurate predictions model, this expectation is taken over both the randomness of the algorithm (if any) and the randomness of the predictions.
Our competitive ratios are expressed as a function of ε , and gracefully degrade as ε goes from 1 to 0.
But, even if ε = 0 , we do not lose robustness; using standard techniques (e.g., [4]), we can combine the best online algorithm without predictions and our algorithm with ε -accurate prediction to match (up to constants) the better of the two solutions.
1.1 Our contributions
First, we consider the problem of caching with ε -accurate predictions.
In this problem, there is an underlying (slow) main memory of n pages; at any given point of time, some k ≪ n of these can be stored in a (fast) cache.
The online input comprises a sequence of page requests p 1 , p 2 , . .
. , p T , with page p t ∈ [ n ] being requested at time t .
If page p t is not in the cache at this time, the algorithm must perform a page swap : it must evict some page from the cache, and load page p t .
The goal of the algorithm is the minimize the number of page swaps over the entire sequence of requests.
Lykouris and Vassilvitskii [18] initiated the study of caching with ML predictions and gave deterministic and randomized algorithms whose competitive ratio gracefully degrades with prediction error.
(See [7, 15, 24, 27] for subsequent work on this problem.)
The general idea in these algorithms is to evict the page whose next request is predicted to be furthest in the future , but robustify this strategy by appropriately combining it with a worst-case randomized marking algorithm if the predictions turn out to be inaccurate.
In our paper, we consider the caching problem with ε -accurate predictions.
At each time, the algorithm is given a prediction for the FIF page in the cache that is correct with probability at least ε ; with the remaining probability, the prediction is just a random page in the cache and hence, does not reveal any information about the future.
A natural algorithm is to simply follow the prediction, namely evict the predicted FIF page if the currently requested page is outside the cache.
We call this the O NE -S TRIKE algorithm and show that it achieves a competitive ratio of O (1 /ε ) .
Our main result is to obtain an exponential improvement over this baseline.
To achieve the better bound, we give a more nuanced algorithm that we call the T WO -S TRIKES algorithm, and show that it achieves a competitive ratio of O (log(1 /ε )) .
We show this bound is tight by giving a matching lower bound of Ω(log(1 /ε )) on the competitive ratio of any algorithm for caching with ε -accurate predictions when ε = 1 /k log k .
(Note that as long as ε > 0 , ε -accurate predictions are more accurate than predictions generated uniformly at random.)
Next, we consider the problem of solving online covering problems given ε -accurate predictions.
Online covering is a general framework for many optimization problems such as set cover and network design.
In this problem, the online algorithm has to maintain a solution on a fixed set of variables, and is only allowed to monotonically increase the variables over time.
In each online step, the algorithm is presented with a new covering constraint on these variables, and must then augment its existing solution to satisfy the new constraint.
The goal is to minimize a linear cost function defined on the variables.
The systematic study of online covering with predictions was initiated by Bamas, Maggiori, and
Svensson [6], who used primal dual techniques to leverage a predicted optimal solution given to the online algorithm (see also [1] for subsequent work on online covering with predictions).
We consider a model where in each online step, the algorithm gets a covering constraint and a predicted optimal way of satisfying the constraint.
(Given an offline predicted solution, these online predictions can be generated on the fly.)
However, these are only ε -accurate predictions.
Namely, in each online step, the predicted solution to the covering constraint is part of an optimal solution with probability at least ε , and otherwise it is an arbitrary way of satisfying the constraint with the remaining probability.
Note that in the latter case, the prediction does not reveal any information about the future.
We give a simple algorithm for online covering with ε -accurate predictions that obtains a competitive ratio of
O (1 /ε ) , and also a matching lower bound of Ω(1 /ε ) .
Our covering framework and algorithm are very flexible: they can even model and solve problems like facility location that are not covering problems in a strict sense.
Related work.
There has been much recent work on incorporating ML predictions in online algorithms, such as in ad-allocation [19], auction pricing [20], page migration [14], flow allocation [17], scheduling [16, 22, 23], frequency estimation [13], speed scaling [5], Bloom filters [21], bipartite and secretary problems [3], and online linear optimization [9].
In particular, the caching problem was studied by [7, 15, 18, 24, 27], where the prediction model is that at each time t , the algorithm is given a prediction of when currently requested page p t is next requested, and the prediction error η is defined as the ℓ 1 error between the predicted and actual request times.
Antoniadis et al.
[2] consider the more general problem of metrical task systems; their predictor gives a state p t of the optimal solution, and the error η is the sum of distances between the predictions and actual states.
The online set cover problem with predictions was studied by [5], where the (offline) prediction provides an entire feasible solution at the outset.
Their algorithm uses the online primal-dual framework, and uses a hyperparameter λ ∈ [0 , 1] to obtain a trade off between the consistency and robustness bounds.
1.2 Preliminaries
For every positive integer n , let [ n ] := { 1 , 2 , . . . , n } .
Let us formalize the prediction model: at each time t , the algorithm is given some prediction or suggestion s t , whose nature depends on the problem statement.
At each time t , the algorithm is given one of two possible suggestions: a “good” suggestion y t , or a “bad” suggestion z t .
While the precise definitions of y t and z t depend on the specific problems, we require that the former reveals some information about the optimal solution, and make no such requirement about the latter.
There is a fixed value ε ∈ (0 , 1] that is unknown to the algorithm.
Now at each time step t , the ε -accurate prediction s t is determined as follows, independently of the past:
[Equation]
We aim to bound the competitive ratio of the algorithm in terms of the noise parameter ε .
Note that the randomness that determines whether s t = y t or s t =
z t is hidden from both the adversary, who generates the input sequence, and the algorithm.
Caching
In the caching problem there is an underlying (slow) main memory of n pages; at any given point of time, some k ≪ n of these can be stored in the (fast) cache.
The online input comprises a sequence of page requests p 1 , p 2 , . .
. , p T , with page p t ∈ [ n ] being requested at time t .
If page p t is already in the algorithm’s cache at this time, the algorithm does not need to do anything, else it must perform a page swap : it must evict some page in the cache, and load the page p t .
The goal of the algorithm is the minimize the number of page swaps over the entire sequence of requests.
Given the request sequence up-front, a strategy that minimizes the number of page swaps is B´el´ady’s rule [8]: at each time t , if the requested page p t is not in the cache, evict the page that is requested the furthest in the future (FIF) among the pages in the cache.
An online algorithm does not know the future requests, so this is not implementable; instead policies such as LRU [26] and Randomized
Marking [12] are used to circumvent this lack of foresight by using past requests to predict the future.
In contrast to the recent work which assumes a prediction for the next-arrival time of the page requested at time t [7, 18, 25, 27], we consider a model where at every time t , the algorithm is provided with a prediction on the page in its cache that will be requested furthest in the future.
The prediction s t is a noisy prediction : with probability ε it is the FIF page, else it is a random page from the algorithm’s cache.
Using the notation from Section 1.2, y t is the FIF page in the algorithm’s cache, and z t is a page chosen uniformly at random from the the algorithm’s cache.
This assumption of uniformity is only made for simplicity.
We can in fact show (see Appendix A.2) that it suffices to assume that the probability that a page p is incorrectly predicted as the FIF page is at most 1 /kε c where c is a constant.
Note the two extremes: if ε = 1 then we can follow B´el´ady’s rule and be optimal; if ε =
then the predictions are just random pages in the cache (which can be generated without any knowledge about the future), and we get back the classic worst-case online setting.
Starting with the first request, we partition the input sequence into phases , where a phase is defined as a maximal contiguous subsequence of requests containing k distinct pages.
(The last phase might contain fewer than k distinct pages because of the termination of the input sequence.)
We note that our algorithms do not actually require suggestions to be precisely the FIF page; they work unchanged as long as the correct predictions provide a page that is not requested in the current phase.
(The FIF page is just one such page.)
All our algorithms use the idea of a cache reset at the beginning of each phase (except the first): replace the contents of the cache with the k pages requested in the previous phase.
Since each page brought back in due to a cache reset must have been evicted after it was last requested in the just-ended phase, we get the following lemma.
Lemma 2.1 (Cache Reset Overhead) .
If an algorithm that performs cache resets at the beginning of each phase, the number of page swaps in any cache reset is at most the number of page swaps performed in the previous phase.
These cache resets allow us to localize the description and analysis of our algorithms to a single phase, because the state of the cache at the beginning of the phase only depends on the input sequence, and is now independent of the algorithm.
Furthermore, we partition the (at most) k pages requested in each phase into two sets: clean pages are the ones that were not requested in the previous phase, and the rest are called stale .
(All the k requested pages in the first phase are considered clean.)
Let ∆ i denote the number of clean pages in the i th phase.
2. O NE S TRIKE : A Deterministic O ( 1 / ε ) -Competitive Algorithm
Our first algorithm O NE S TRIKE using ε -accurate predictions is simple and deterministic, and obtains a competitive ratio of O (1 /ε ) .
In the first phase, it fetches each requested page into the cache.
After this point in time, the cache always remains full (with k pages).
Each subsequent phase starts with a cache reset.
Let C t denote the algorithm’s cache contents at the end of timestep t .
During the phase, the algorithm is the following:
(a) If the requested page p t is already in C t − 1 , do nothing (i.e., it sets C t ← C t − 1 ).
(b) Else if p t ̸∈ C t − 1 , evict the predicted page s t , i.e., set C t ← ( C t − 1 \ s t ) ∪ { p t } .
Theorem 2.2.
The O NE S TRIKE Algorithm is O (1 /ε )
-competitive.
Remark.
The O NE S TRIKE algorithm and its analysis both apply assuming a weaker prediction model, in which the z t predictions (i.e., the non-good ones) are chosen adversarially, rather than uniformly at random among the pages in the algorithm’s cache.
Note that in this model, an adversary still does not know when good predictions are given, but can adapt to the algorithm’s behavior when specifying the z t predictions.
2. T WO S TRIKES : A Randomized O (log 1 / ε ) -Competitive Algorithm
We now use randomization to improve the competitive ratio to O (log(1 /ε )) .
Before describing the formal algorithm, we first give some intuition.
The O NE S TRIKE algorithm uses the prediction every time it must make a page swap.
This places too much faith on the predictions, and incurs a large loss.
Our first change is that the algorithm is more cautious with the predictions, and now views two predictions for the same page (and not just a single prediction) as a strong-enough signal to evict the page.
We show that the probability that a page that remains the FIF page long enough is predicted twice far outweighs the probability that any non-FIF page is (erroneously) predicted twice during the course of the entire phase.
As we now need two predictions before evicting a page, we need a fallback option if the requested page is not in the cache and no page has been predicted twice.
We run a randomized marking algorithm (call it M ARKER ) for this purpose, and carefully combine these two algorithms to obtain the final algorithm.
However, this does not suffice: consider a situation where the length of the request sequence for which a page remains the FIF page in the cache is very short.
(An extreme example is when pages are requested round-robin, in which case every page is the FIF page right after it is requested and remains so for only a single request.)
In this case, none of the FIF pages maintain their FIF status long enough to be predicted twice, and the algorithm devolves to essentially being M ARKER with a competitive ratio of O (log k ) .
To handle this situation, we stop the algorithm once we are confident that we have seen at least ∆ FIF pages in the predictions, where ∆ is the number of clean pages requested in the phase.
At this point, we switch to a different algorithm, which is again M ARKER but run only on pages predicted earlier in the phase.
2.2.1 The T WO S TRIKES Algorithm
We now formally describe the T WO S TRIKES algorithm.
(In this section we assume that we know the accuracy parameter ε : we remove this assumption later in the supplementary material.)
As in
O NE S TRIKE , the first phase in T WO S TRIKES brings the first k requested pages into the cache and does no evictions.
Every subsequent phase begins with a cache reset to ensure that the pages in the cache are precisely those requested in the previous phase.
We now describe the behavior of the
T WO S TRIKES algorithm for a single phase.
Epochs and Segments.
Since the algorithm does not know ∆ (the number of clean requests in this phase), it maintains a guess (cid:98) ∆ , which starts at 1 and is periodically updated.
These updates break the phase into epochs : the first epoch starts at the beginning of the phase; each time we observe that the number of clean requests in the phase exceeds our guess (cid:98) ∆ , we double the value of (cid:98) ∆ , thereby ending the current epoch and starting a new one.
When an epoch starts, T WO S TRIKES first performs a cache reset, and then checks if ε ≤ ( (cid:98) ∆ / k ) 1 / 5 ; if so, it simply runs randomized marking in the rest of the current epoch.
Else if ε > ( (cid:98) ∆ / k ) 1 / 5 , the epoch now is partitioned into an explore segment followed by an exploit segment .
In the explore segment, the algorithm makes (cid:98) ∆ ∗ good evictions of pages that have been predicted twice (for some (cid:98) ∆ ∗ ≤ (cid:98) ∆ ), and also learns a small candidate set of pages that contains at least (cid:98) ∆ − (cid:98) ∆ ∗ pages which make for good evictions.
In the following exploit segment, the algorithm then runs randomized marking on these candidate pages to actually make (cid:98) ∆ − (cid:98) ∆ ∗ good evictions.
Before we give details about these two segments, let us give two procedures: M ARKER and S TRIKER .
The M ARKER procedure maintains a binary flag called M ARK for every page; we say that page p is marked if M ARK ( p ) = 1, else it is unmarked .
We mark and unmark pages by changing the flag toor 0 respectively.
All pages are unmarked at the beginning of the epoch.
The M ARKER algorithm essentially runs the R ANDOM M
ARKING algorithm, but since we may run it starting with only a few unmarked pages, we allow for the possibility of running out of unmarked pages—in which case we declare failure.
The details of M ARKER appear in Algorithm 1.
1.1 let C be the set of pages in the cache 1.2 if page p t is requested at the current time t do 1.
case p t ∈ C do do nothing 1.
case p t ̸∈ C and | C
| <
k do C ← C ∪ { p t } 1.
case p t ̸∈ C and | C | =
k and C has at least one unmarked page do 1.
let q t be a uniformly random unmarked page in C , and set C ← ( C \ { q t } ) ∪ { p t } 1.
otherwise do declare F AIL 1.8 mark page p t
The second procedure is S TRIKER : it maintains a counter called S TRIKE for every page, which takes on values in { 0 , 1 , 2 } .
we say that page p is striked if S TRIKE ( p ) ∈ { 1 , 2 } , otherwise S TRIKE ( p ) =
and page p is unstriked .
If S TRIKE ( p ) = 2 , we say page p is strike-evicted .
At the beginning of the epoch, all pages are unstriked.
The S TRIKER procedure operates in two modes: active and passive .
The procedure is in the active mode when the cache contains k pages (i.e., it is full), and it is in the passive mode (and does nothing) otherwise.
Like M ARKER , S TRIKER is not a stand-alone caching algorithm; instead, it is active when the cache is full to acknowledge the prediction, and possibly performs a preemptive eviction.
The details appear in Algorithm 2.
2.1 let C be the set of pages in the cache 2.2 if | C | < k then do nothing (we are in the passive mode) 2.3 else if page s t ∈ C is the predicted page at the current time t then 2.
S TRIKE ( s t )++ 2.
if S TRIKE ( s t ) = 2 then evict s t , so C ← C \ { s t } (so that s t is strike-evicted )
Switching to O NE S TRIKE .
In both the explore and exploit segments, it is possible for the algorithm to switch to the O NE S TRIKE algorithm.
When this happens, all marks and strikes are forgotten, and the algorithm simply evicts the predicted page whenever an eviction is required.
The only state that remains is the count on the number of clean pages in the phase so far: whenever it exceeds (cid:98) ∆ , regardless of the state of the algorithm, we double the value of (cid:98) ∆ and start a new epoch.
The Explore Segment.
We now describe our algorithm for the explore segment.
It uses a global counter called B AD -S TRIKES , initialized to 0 at the beginning of each epoch, that counts the number of bad evictions made by the S TRIKER procedure.
Recall that an eviction at time t is good if the evicted page is not requested in the current phase after time t , and it is bad otherwise.
Before serving each request, the algorithm first increments B AD -S TRIKES as necessary, and then calls S TRIKER and
M ARKER in that order.
The formal description is in Algorithm 3.
The explore segment ends if either (a) S TRIKER makes at least 2 (cid:98) ∆ evictions in the segment, or (b) S TRIKER has been in active mode for
N := (cid:98) ∆ / ε 2 requests.
Lemma 2.3.
In the explore segment, the M ARKER procedure never declares F AIL .
Proof.
Pages are marked only when they are requested in the current epoch.
So, if p t ̸∈ C and C has k marked pages, then k + 1 distinct pages have been requested in the current epoch, and therefore also in the current phase.
This contradicts the definition of a phase.
The Exploit Segment.
The exploit segment ignores all predictions.
Instead it relies on the fact (proved in Lemma 2.10) that the set of striked pages at the end of the explore segment contains (cid:98) ∆
Algorithm
3.1 foreach time t do 3.
let p t be the requested page and s t the predicted page at time t 3.
if p t is strike-evicted (i.e., S TRIKE ( p t ) = 2 ) then increment B AD -S TRIKES 3.
if B AD -S TRIKES = (cid:98) ∆ then run O NE S TRIKE for rest of epoch else set S TRIKE ( p t ) ←3.
call S TRIKER 3.
call M ARKER 3. terminate explore segment if S TRIKER evicts pages ≥ 2 (cid:98) ∆ times, or S TRIKER in active mode for N := (cid:98) ∆ / ε 2 requests pages that would be good evictions (with good probability).
The exploit segment now runs M ARKER on these striked pages.
Formally, see Algorithm 4.
4.1 mark all pages in the cache with no strikes; striked pages are left unmarked 4.2 foreach time t do 4.
let p t be page requested at time t 4.
if p t is strike-evicted (i.e., S TRIKE ( p t ) = 2 ) then increment B AD -S TRIKES 4.
if B AD -S TRIKES = (cid:98) ∆ then run O NE S TRIKE for rest of epoch else set S TRIKE ( p t )
←4.
call M ARKER 4.
if M ARKER returns F AIL then run O NE S TRIKE for the rest of the epoch
Since the exploit segment handles the possibility that M ARKER may fail (and reverts to O NE S TRIKE in that case), the algorithm is well-defined; it only remains to bound the expected number of evictions per epoch, and hence per phase.
This is what we do next.
2.2.2 Competitive Ratio of the T WO S TRIKES Algorithm
Theorem 2.4.
The algorithm performs O ( (cid:98) ∆ log 1 / ε ) evictions in expectation in an epoch.
Proof.
There are four types of evictions that happen during an epoch:
(i) evictions performed by S TRIKER in the explore segment, (ii) evictions performed by M ARKER in the explore segment, (iii) evictions performed by M ARKER in the exploit segment, and (iv) evictions due to the O NE S TRIKE algorithm,
We show that the expected number of each of type of eviction is at most O ( (cid:98) ∆ log 1 / ε ) .
The type (i) evictions are the easiest: there are at most 2 (cid:98) ∆ of these, by the termination condition of the explore segment.
Next we bound the number of evictions of type (iii): consider running M ARKER with some cache C 0 , where some k − r pages are pre-marked.
Consider the r unmarked pages of C 0 , and order them as p 1 , p 2 , . .
, p r in reverse chronological order of their first request in this segment.
The pages that are not requested at all are placed at the beginning of this sequence, but can be arbitrarily ordered relative to each other.
Let D be the number of requests for pages outside the set C 0 received by the algorithm.
The following property holds by induction, since only D pages are evicted, and each unmarked page is equally likely to be evicted at any time:
Lemma 2.5.
At any time t , suppose pages p i t +1 , p i t +2 , . .
. , p r have already been requested and pages p 1 , p 2 , . .
, p
i t have not been requested yet.
Then, for any i ≤ i t , the probability that page p i is not in the cache of the M ARKER procedure at time t is at most min( D / i t , 1) .
Note that the property of this lemma is unconditional, in the sense that it does not depend on the set of pages among p i t +1 , p i t +2 , . . .
, p r that were evicted before time t .
The following corollary follows by applying this lemma at the time of the first request for page p i :
Corollary 2.6.
The probability that the cache of the M ARKER procedure does not contain page p i at the time of its first request is at most min( D / i , 1) .
The next lemma is proved using the above corollary:
Lemma 2.7.
The expected number of evictions of type (iii) in an epoch is O ( (cid:98) ∆ log(1 /ε )) .
Proof.
The explore segment terminates after it sees at most N = (cid:98) ∆ / ε 2 requests for which S TRIKER is in active mode.
Let S denote the set of striked pages; clearly, | S | ≤ N .
Moreover, the number of distinct clean page requests is at most (cid:98) ∆ , else the epoch ends.
By Corollary 2.6, the expected number of evictions in S is at most
[Equation] Bounding evictions of type (ii) is a bit more involved, because we start off with k unmarked pages (so the naive application of Corollary 2.6 would give us O ( (cid:98) ∆ log k ) ); we need to use the interplay between M ARKER and S TRIKER to get our bound.
Lemma 2.8.
The expected number of evictions of type (ii) in an epoch is O ( (cid:98) ∆ log(1 /ε )) .
Finally, to bound the number of type (iv) evictions, observe that we run O NE S TRIKE if the counter
B AD -S TRIKES reaches (cid:98) ∆ , or if M ARKER returns F AIL in the exploit segment.
We claim that both of these events happen with probability at most ε .
Now since O NE S TRIKE makes O ( (cid:98) ∆ /ε ) evictions in expectation the expected number of such evictions is at most ε · O ( (cid:98) ∆ /ε )
=
O ( (cid:98) ∆) .
Lemma 2.9.
Pr[ B AD -S TRIKES ≥ (cid:98) ∆] ≤ ε .
Lemma 2.10.
The probability that M ARKER declares F AIL in the exploit segment is at most O ( ε ) .
We now summarize the bounds on the four types of evictions.
In the explore segment, S TRIKER performs at most 2 (cid:98) ∆ evictions by design of the algorithm, and M ARKER performs O ( (cid:98) ∆ log(1 /ε )) evictions by Lemma 2.8.
In the exploit segment, M ARKER performs O ( (cid:98) ∆ log(1 /ε ))
evictions by
Lemma 2.7.
Finally, Lemmas 2.9 and 2.10 show that O NE S TRIKE is called with probability O ( ε ) , and its cost is O ( (cid:98) ∆ /ε ) , so its expected contribution is O ( (cid:98) ∆) evictions.
Combining everything together, the total expected number of evictions in any epoch is at most O ( (cid:98) ∆ log 1 / ε ) , which proves
Theorem 2.4.
Since we double our guess for (cid:98) ∆ each time, the total expected cost of a phase is O (∆ log 1 / ε ) , thereby proving the claimed competitive ratio for the known- ε case.
The algorithm (and analysis) when we do not know the value of ε in advance are conceptually similar to the one above, but there are more details to consider.
In particular, we maintain a guess ˆ ε for ε , and each time we square this guess.
The real problem is that unlike the value of ∆ , we do not get a clear signal that we have overestimated the value of ε .
Our algorithm therefore needs to infer failure from our algorithm not performing as claimed; we defer this to the supplementary materials.
Comparison with [27].
We now show that under our prediction model, the algorithm given by
Wei [27] performs poorly.
That algorithm combines R ANDOM M ARKING and BlindOracle (which in our terminology is called O NE S TRIKE ).
Since the BlindOracle algorithm just evicts the page suggested by the oracle, we take n = k + 1 pages and construct a sequence of phases.
In phase i we request all pages except page i round-robin, and do this k times.
The optimal strategy is to evict page i at the start of this phase.
But the algorithm follows the oracle blindly, so it will evict random pages due to bad suggestions 1 /ε times in expectation before getting a good suggestion and evicting page i .
This happens in each phase, giving an expected cost Ω(1 /ε ) times the optimum.
Since this is combined with R ANDOM M ARKING which has an Ω(log k ) lower bound, by setting ε = 1 / log k and interleaving phases of the above lower bound sequence with phases of the lower bound for R ANDOM
M ARKING , we get a sequence that causes Wei’s algorithm to pay Ω(log k ) times the optimal cost, whereas our algorithm pays O (log(1 /ε ))
=
O (log log k ) times the optimal cost.
Set Cover and Generalized Covering Problems
We now show that for a large class of online covering problems, which includes set cover (and its multiset multicover variants), facility location, and network design problems such as Steiner tree and
Steiner forest, we can obtain an O (1 /ε )
-competitive
algorithm with ε -accurate predictions.
We first present it for the case of online set cover, and then extend the ideas to more general settings.
3.1 The Set Cover Problem
In the S ET C OVER problem we are given a collection of m subsets S :
= { S 1 , . . .
, S m } of a universe
U containing | U | = n elements.
Each set has a cost c ( S ) ≥ 0 , and we want to pick a subcollection of least cost covering the universe.
In the online version of the problem, we do not know the set system in advance: an element e t ∈ U is revealted at each time t , along with the names of the sets containing e t .
If none of these sets have already been chosen by the algorithm, one must be chosen at this time.
Sets once chosen cannot be dropped (so the solutions are monotonically increasing), and the goal is to minimize the total cost of the chosen sets.
Our model of ε -accurate suggestions is the following: at each time, we are given an element e t , along with a suggested set s t ∈ S , with the guarantee that Pr[ s t ∈ OPT | H t − 1 ] ≥ ε , where H t − 1 is the history of all requests, predictions, and actions taken in previous steps, and OPT is the optimal offline solution.
S ET -H EDGE : If e t is already covered, do nothing.
Else let g t be the minimum-cost set that covers e t .
Choose s t with probability c ( g t ) /c
( s t ) , and choose g t otherwise.
Since g t is the cheapest set covering e t , we have c (
g
t ) /c ( s t ≤ 1 and hence a valid probability.
Theorem 3.1.
Given ε -accurate predictions, the S ET -H EDGE algorithm is 2 /ε -competitive.
This result is tight up to constant factors: we show in the supplementary material that no algorithm for set cover can have competitive ratio better than O (1 /ε ) in general.
Moreover, we can run this algorithm in parallel with any other online set cover algorithm, say one that is α SC -competitive, to get an algorithm that is O
(min(1 /ε, α SC )) -competitive.
3.2 Extension to Generalized Covering Problems
The simplicity of the algorithm allows us to extend to very general set of objective functions and constraints, which we call generalized submodular-cost coverage (GSCC).
Consider the following:
The algorithm controls a point x ∈ R d ≥ 0 .
The initial point is x 0 = 0 , the all-zeros vector.
We require that x is monotone over time; i.e., x t − 1 ≤ x t . 2.
(Covering.)
At each time t , a set K t ⊆ R d ≥ 0 is revealed, and we want that x ∈ ∩ s ≤ t K s .
We restrict ourselves to sets that are closed under taking component-wise maximums—i
e., x, y ∈ K t = ⇒ (
x ∨ y ) ∈ K t , where ( x ∨ y )
i = max( x i , y i ) .
(Monotonicity and Submodularity.)
The objective function c : R d → R ≥ 0 is monotone : if x ≤ y then c ( x ) ≤ c ( y ) .
Moreover, it is submodular : c ( x ∨ y ∨ z ) − c
( x ∨ z ) ≤ c ( x ∨ y ) − c ( x ) .
The ε -accurate suggestion model now says: at each time t , the suggestion s t ∈ K t , and moreover
Pr[ s t ≤ x ∗ | H t − 1 ] ≥ ε , where x ∗ is the optimal offline solution.
The C OVER -H EDGE algorithm now extends the S ET -H EDGE algorithm as follows:
Let g t be the minimum-cost increment—i.e., g t ← arg min { c ( x t − 1 ∨ g ) | g ∈ K t } .
Then set x t ← x t − 1 ∨ s t with probability c ( x t − 1 ∨ g t ) − c ( x t − 1 ) c ( x t − 1 ∨ s t ) − c ( x t − 1 ) , and x t ← x t − ∨ g t otherwise.
In general, finding this miminum-cost increment may be computationally hard; we focus on the information-theoretic considerations for now, and defer the computational issues for later.
Theorem 3.2.
Given ε -accurate suggestions, the C OVER -H EDGE algorithm is 2 /ε -competitive for any generalized covering problem.
3.3 Applications
Beyond set cover, the general covering formulation above captures several interesting problems:
Network Design:
In the Survivable Network Design problem (which generalizes Steiner Tree and
Steiner Forest ) we are given a set V of n points together with the distances d ij between them i, j ∈ V .
The goal is to connect k pairs of points { ( s ℓ , t ℓ )
∈ V × V | ℓ ∈ [ k ] } at minimum cost, where each pair ( s ℓ , t ℓ ) comes with a connectivity requirement of r ℓ disjoint paths between them.
This problem can be written as
[Equation]
This formulation satisfy the Covering, Monotonicity, and Submodularity properties.
Moreover, the least-cost augmentation g t can be obtained in polynomial time by a minimum cost flow algorithm.
Facility Location: This is not a covering program, yet it can be modeled using our framework.
Given a point set V on n points and distances d ij between points i, j ∈ V , and opening costs f i ≥ 0 for each i ∈ V , the goal is to designate some subset F of points as facilities, so that the total cost of (cid:80) [Equation] i + [Equation]
∈
[Equation]
min i ∈ F d ij is minimized.
We can write this using Balinski’s MILP formulation:
[Equation]
It can be verified that this formulation also satisfies the Covering, Monotonicity, and Submodularity properties, despite the non-covering constraints of the form x ij ≤ y i .
(Indeed, in the supplementary material, we show that the coordinate-wise maximum covering property allows us to go beyond standard covering programs.)
Moreover, the least-cost augmentation g t can be obtained in polynomial time using a simple greedy algorithm.
Covering Mixed-Integer Linear Programs (MILPs): given non-negative A ∈ R m × n , b ∈ R m and c, u ∈ R n , and a subset I ⊆ [ n ] , we want to solve
[Equation]
Each constraint is a half-space, and it can be verified that this formulation satisfies the Covering,
Monotonicity, and Submodularity properties.
However, since this problem is NP-hard in general, the least-cost augmentation g t can be computed efficiently only in some cases such as the network design problems described above.
Conclusions
In this paper, we presented online algorithms augmented with ε -accurate predictions for several classic problems such as caching, set cover, facility location, Steiner tree, and generalizations.
Can we show a a poly log(1 /ε ) competitiveness, or even f ( ε ) competitiveness for the k -server problem, which is an extension of our results for caching?
Another direction would be to combine the ε -accuracy prediction model studied in this paper with some measure η of total prediction error namely, design online algorithms augmented by probabilistically approximately correct (or PAC) predictions.
Finally, a third direction of future work would be a thorough experimental analysis of our framework and algorithms, to empirically compare the performance of our work with that of other learning-augmented algorithms.
Acknowledgments
AG and BS were supported in part by NSF awards CCF-1955785, CCF-2006953, and CCF-2224718.
DP and KS were supported in part by NSF grants CCF-1750140 (CAREER) and CCF-1955703 and
ARO grant W911NF2110230.
Checklist
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] See Section 4, where we list the problems we consider and directions for future work.
(c) Did you discuss any potential negative societal impacts of your work?
[N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] (b) Did you include complete proofs of all theoretical results?
[Yes] Most proofs are in the supplementary material.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[N/A] (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
[N/A] (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[N/A] (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[N/A]
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[N/A] (b) Did you mention the license of the assets?
[N/A] (c) Did you include any new assets either in the supplemental material or as a URL?
[N/A] (d) Did you discuss whether
and how consent was obtained from people whose data you’re using/curating?
[N/A] (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A] 5.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]
Organization.
Appendix A and Appendix B contain the missing proofs for Section 2, namely:
• Appendix A.1 contains the proofs for the O NE S TRIKE algorithm from Section 2.1.
• Appendix A.2 contains the proofs required for Section 2.2.
• Appendix B describes and analyzes the T WO S TRIKES UA algorithm, which is an extension of the T WO S TRIKES to the case where the ε is not known.
• Appendix B.2 proves the Ω(log(1 /ε )) randomized lower bound.
Appendix C presents the missing proofs for Section 3, namely:
• Appendix C.1 contains the proofs of Theorem 3.1 and Theorem 3.2.
• Appendix C.2 contains the proof of Theorem 3.2 for the case where the objective function is separable.
• Appendix C.3 shows a syntactic characterization of generalized covering problems over half-spaces, which allows the extension of our results to problems such as facility location, as mentioned in Section 3.3.
• Appendix C.4 proves the Ω(1 /ε ) randomized lower bound.
A Missing Proofs from Section
First, we prove Lemma 2.1 (Cache Reset Overhead):
Proof of Lemma 2.1.
Every page that is being brought into the cache during the cache reset must have been swapped out in the previous phase after serving its request.
The lemma follows.
A.1 Proofs for the O NE S TRIKE algorithm
Next, we prove Theorem 2.2, the competitive ratio of the O NE S TRIKE algorithm.
First, we introduce some helper lemmas.
The first lemma is a standard property of caching that helps lower bound the cost of any feasible solution:
Lemma A.1 (Lower Bound on the Optimal Cost) .
The number of page swaps in any feasible solution (and therefore, in an optimal solution) is at least (cid:80) i ≥ 2 ∆ i / 2 , where ∆ i is the number of clean pages requested in phase i .
Proof.
For any i ≥ 2 , a total of k + ∆ i distinct pages are requested across phases i −
and i , which means that any feasible solution must perform at least ∆ i page swaps across these two phases.
The lemma follows by summing over all the values of i .
At any time t , recall that a good eviction is one where the evicted page is not requested in the current phase after time t .
Once evicted, such a page does not return to the cache for the rest of the phase.
This allows us to relate good evictions to clean requests:
Lemma A.2 (Good Evictions vs. Clean Requests) .
The number of good evictions in phase i is at most ∆ i , the number of clean pages requested in the phase.
Proof.
Note that a total of k + ∆ i pages are requested across phases i −
and i .
After ∆ i good evictions in phase i , all subsequent requests in phase i are for the remaining k pages.
The cache can hold all these k pages, so there cannot be any further page swaps in phase i .
Finally, we relate good evictions to FIF pages:
Lemma A.3 (Good Evictions vs. FIF Pages) .
At any time t , if the cache contains k pages and the
FIF page is evicted to serve a request for a page not currently in the cache, then this is necessarily a good eviction.
Proof.
Excluding the currently requested page, at most k − 1 other pages can be requested after time t in the current phase.
Now, note that the k − 1 pages in the cache other than the FIF page are requested before the FIF page after time t .
The lemma follows.
Now, we are ready to prove Theorem 2.2:
Proof of Theorem 2.2.
By Lemma 2.1 and Lemma A.1, it suffices to prove that the expected number of page evictions of the algorithm in a given phase is at most ∆ /ε , where ∆ is the number of clean pages requested in the phase.
By Lemma A.3 and the ε -accuracy condition, every eviction is a good eviction with probability at least ε .
It follows by Lemma A.2 that the expected number of page evictions made by the O NE S TRIKE algorithm in the current phase is at most ∆ /ε .
A.2 Proofs for the T WO S TRIKES algorithm
Now we provide the missing proofs for establishing the competitive ratio of the T WO S TRIKES algorithm.
Proof of Lemma 2.8.
Suppose p 1 , p 2 , . .
. , p k are the unmarked pages in the cache at the beginning of the epoch in reverse chronological order of their first requests in this segment.
The pages that are not requested at all are placed at the beginning of this sequence, but can be arbitrarily ordered relative to each other.
As in Lemma 2.7, the number of clean requests for pages is at most (cid:98) ∆ , else the epoch ends.
So by Corollary 2.6, the expected number of evictions of type (ii) among pages p 1 , p 2 , . .
. , p 2 N is again at most O ( (cid:98) ∆ log(1 /ε )) , using the same argument as in Lemma 2.7.
But what about evictions of type (ii) among the remaining pages p 2 N +1 , . . .
, p k ?
Suppose at time t , the first request for page p
i t causes a type (ii) eviction of a page in p 2 N +1 , . .
, p k .
At this point in time, the cache must be full (else we would not have evicted a page), so the S TRIKER algorithm is active at the end of time t .
By Lemma 2.5, the probability that some page p j has been evicted by M ARKER by time t is at most (cid:98) ∆ / i t ≤ (cid:98) ∆ / 2 N = ε 2 / 2 for any j ∈ { 2 N + 1 , . . .
, k } .
By the union bound, none of the pages p j for j ∈ { 2 N + 1 , . . .
, k } satisfying j ∈
[ i t − 1 / ε 2 , i t ) have been evicted by M ARKER by time t , with probability at least 1 / 2 .
Supposse this event happens.
Since S TRIKER is now active, one of the following events must happen in the next 1 / ε 2 requests:
E a : There is a type (i) eviction in these 1 / ε 2 requests, or E b : The S TRIKER procedure is active for all these 1 / ε 2 requests.
In either case, we can charge to the corresponding event.
By the first termination condition for the explore segment, event E a happens at most 2 (cid:98) ∆ times.
By second termination for the explore segment, event E b happens at most (cid:98) ∆ times.
Putting these together, we conclude that the expected number of type (ii) evictions for pages p 2 N +1 , . . .
, p k is O ( (cid:98) ∆) , and the total expected type (ii) evictions are at most O ( (cid:98) ∆ log(1 /ε )) .
Proof of Lemma 2.9.
We show that E [ B AD -S TRIKES ] ≤ ε (cid:98) ∆ , whereupon Markov’s inequality implies the claimed probability bound.
Indeed, fix any page p , and consider the expected number of times that the counter B AD -S TRIKES is incremented due to p .
For any such increment, p must be predicted twice when it is not the FIF page in a cache containing k pages.
This is because if p is the
FIF page in any of these predictions, then by Lemma A.3, p is a good eviction.
By the termination condition for S TRIKER , it is active mode for at most N = (cid:98) ∆ /ε 2 steps.
So the expected contribution of p to B AD -S
TRIKES is at most
[Equation]
By linearity of expectation, the expected value of the counter B AD -S TRIKES is at most
[Equation]
since (cid:98) [Equation]
Relaxing the prediction model.
The proof of Lemma 2.9 assumes that the probability that a page p is predicted when it is not the FIF page in a cache containing k pages is at most 1 /k .
Now we show that the lemma still holds assuming this probability is at most 1 /kε c for any c > 0 .
The proof is essentially the same, but we need to change a few constants.
Now, the expected contribution of p to
B AD -S TRIKES is at most
[Equation]
By linearity of expectation, it suffices to show that this quantity is at most ε (cid:98) ∆ /k .
This holds if we set N = (cid:98) ∆ /ε
d and assume (cid:98) ∆ < ε 2 c +2 d +1 k .
(In the proof of Lemma 2.9, we assumed c = 0 and set d = 2 .)
Under these modifications, all of the other proofs still hold; this lemma was the only one relying on an upper bound on the probability of a page being incorrectly predicted as FIF.
Proof of Lemma 2.10.
We call a strike good if it applies to a page that will not be requested in the rest of the phase.
Let S denote the number of pages struck by at least one good strike during the explore segment.
It suffices to show S ≥ (cid:98) ∆ with probability 1 − O ( ε ) .
If this happens, then at the beginning of the exploit phase, there are at least (cid:98) ∆ good pages that have either been struck or evicted, hence we would not run out of unmarked pages before the epoch ends.
Suppose the explore segment ends due to the first termination condition: S TRIKER has made 2 (cid:98) ∆ evictions.
By Lemma 2.9, with probability 1 − ε , at most (cid:98) ∆ of these evictions are bad, so at least (cid:98) ∆ of them are good, as desired.
Now suppose the explore segment ends due to the second termination condition: S TRIKER has been in active mode for N = (cid:98) ∆ /ε 2 requests.
Whenever S TRIKER is in active mode, it strikes the predicted page (and possibly evicts it).
Conditioned on the past, each strike is good with probability at least ε , so the expected number of good strikes is at least εN = (cid:98) ∆ /ε .
Some of these good strikes apply to the same page, but S TRIKER evicts any page with two strikes, so among the good strikes, at most (cid:98) ∆ of them apply to pages that already have a good strike.
Thus, we have E [ S ] ≥ (cid:98) ∆ /ε − (cid:98) ∆ .
We now finish with a concentration bound; we want to show that S < (cid:98) ∆ with probability O ( ε ) .
Letting δ = 1 − 1 / ( 1 / ε − 1) and µ = (cid:98) ∆ /ε − (cid:98) ∆ , by a standard Chernoff bound, we have
Pr [Equation] S < [Equation]
∆ [Equation] = [Equation]
=
O ( [Equation] ) , assuming ε is sufficiently small.
B Caching with ε -Accurate Predictions for Unknown ε
In this section, we formally describe the T WO S TRIKES UA algorithm for unknown accuracy ε .
At a high level, the algorithm is similar to the one described for known ε : each phase begins with a cache reset to ensure that the pages in the cache are precisely those requested in the previous phase.
Within a phase, there is an outer loop that iterates over epochs , and an inner loop that iterates over blocks .
Each epoch has a fixed value of (cid:98) ∆ , which is initialized to 1 at the beginning of the phase.
When the number of clean pages requested in an epoch exceeds (cid:98) ∆ , we end the epoch, perform a cache reset, and start a new epoch after doubling the value of (cid:98) ∆ .
Each block fixes the value of ˆ ε , which is initialized to 1 / 2 (or any constant strictly less than 1) at the beginning of an epoch.
The condition for ending a block and starting a new one is more complicated than that for an epoch because there is no direct way for the algorithm to detect if ε < ˆ ε .
We will describe this condition later as part of the internals of a block.
Within a block starts, T WO S TRIKES UA first checks if ˆ ε ≤ ( (cid:98) ∆ / k ) 1 / 5 ; if so, it simply runs randomized marking in the rest of the current epoch.
Else if ˆ ε > ( (cid:98) ∆ / k ) 1 / 5 , the block now is partitioned into an explore segment followed by an exploit segment .
In the explore segment, the algorithm makes (cid:98) ∆ ∗ good evictions of pages that have been predicted twice (for some (cid:98) ∆ ∗ ≤ (cid:98) ∆ ), and also learns an additional candidate set of pages that contains at least (cid:98) ∆ − (cid:98) ∆ ∗ pages which would be good evictions.
In the following exploit segment, the algorithm runs randomized marking on these candidate pages to actually make (cid:98) ∆ − (cid:98) ∆ ∗ good evictions.
The algorithm requires the procedures M ARKER and S TRIKER .
Both are identical to their respective counterparts from Section 2, where ε was known.
The explore and exploit segments are largely identical to their counterparts as well, with minor changes that we now describe.
The Explore Segment.
The explore segment is almost identical to its counterpart from Section 2.
The only difference is the following: If B AD -S TRIKES
(initially 0 at the beginning of each block) reaches (cid:98) ∆ , then we end the current block, perform a cache reset, and start a new block after squaring the value of ˆ ε .
The details are in Algorithm 5.
Algorithm 5:
5.1 foreach time t do 5.
let p t be the requested page and s t the predicted page at time t 5.
if p t is strike-evicted (i.e., S TRIKE ( p t ) = 2 ) then increment B AD -S TRIKES 5.
if B AD -S TRIKES = (cid:98) ∆ then square ˆ ε and start a new block else set S TRIKE ( p t ) ←5.
call S TRIKER 5.
call M ARKER 5. terminate explore segment if S TRIKER evicts pages ≥ 2 (cid:98) ∆ times, or S TRIKER in active mode for N := (cid:98) ∆ / ˆ ε 2 requests
The Exploit Segment.
The exploit segment is also almost identical to its counterpart from Section 2.
As was the case for the explore segment, the only difference is that if B AD -S TRIKES reaches (cid:98) ∆ , then we end the current block, perform a cache reset, and start a new block after squaring the value of ˆ ε .
The details are in Algorithm 6.
6.1 let S ← striked pages from the explore segment 6.2 mark all pages in the cache not in S ; pages in S are unmarked 6.3 if p t requested at time t then 6.
if p t is strike-evicted (i.e., S TRIKE ( p t ) = 2 ) then increment B AD -S TRIKES 6.
if B AD -S TRIKES = (cid:98) ∆ then square ˆ ε and start a new block else set S TRIKE ( p t ) ←6.
call M ARKER if M ARKER returns
F AIL then square ˆ ε and start a new block
Note that the T WO S TRIKES UA
algorithm, unlike T WO S TRIKES from Section 2, does not call
O NE S TRIKE at any point.
Instead, whenever B AD -S TRIKES reaches (cid:98) ∆ , it squares ˆ ε and starts a new block.
B.1 Competitive ratio of the T WO S TRIKES UA algorithm
In any block, there are three types of page evictions in the randomized algorithm:
(i) evictions performed by S TRIKER in the explore segment, (ii) evictions performed by M ARKER in the explore segment, and (iii) evictions performed by M ARKER in the exploit segment
We can bound all three types using the same proofs from from Section 2, except we replace ε with ˆ ε .
Furthermore, the page swaps during the cache reset at the beginning of a block can be charged to the page evictions in the previous block.
So, we have arrived at the following bound:
Lemma B.1.
The expected number of evictions in a block is O ( (cid:98) ∆ · log(1 / ˆ ε )) .
Now we address the main difference between T WO S TRIKES UA and T WO S TRIKES , which is the block structure due to our guess ˆ ε of ε .
At a high level, Lemma B.1 allows us to bound the cost incurred in blocks where ˆ ε > ε , because squaring ˆ ε creates a geometric series over these blocks.
For blocks where ˆ ε < ε , we now show that the probability of starting a new block is at most 2ˆ ε .
This will in fact allow us to bound the total cost over these blocks by O ( (cid:98) ∆) .
Lemma B.2.
Pr[ B AD -S TRIKES ≥ (cid:98) ∆] ≤ ˆ ε .
Proof.
The proof is identical to that of Lemma 2.9, except with ˆ ε instead of ε .
Lemma B.3.
In any block where ˆ ε ≤ ε , the probability that M ARKER declares F AIL is O
(ˆ ε ) .
Proof.
The proof is identical to that of Lemma 2.10, except with ˆ ε instead of ε .
More specifically, suppose the explore segment ends due to the first termination condition (i.e., S TRIKER has made 2 (cid:98) ∆ evictions).
Then by Lemma B.2, with probability 1 − ˆ ε , at most (cid:98) ∆ of these evictions are bad so at least (cid:98) ∆ of them are good, as desired.
Now suppose the explore segment ends due to the second termination condition: S TRIKER has been in active mode for N = (cid:98) ∆ / ˆ ε 2 requests.
Whenever S TRIKER is in active mode, it strikes the predicted page (and possibly evicts it).
Conditioned on the past, each strike is good with probability at least ε , so the expected number of good strikes is at least εN = ε (cid:98) ∆ / ˆ ε 2 ≥ (cid:98) ∆ / ˆ ε .
The rest of the proof is identical to that of Lemma 2.10, except with ˆ ε instead of ε .
Lemma B.4.
If ˆ ε ≤ ε , then the probability that the algorithm starts a new block is at most O (ˆ ε ) .
Proof.
There are two ways for the algorithm to start a new block: if B AD -S TRIKES
= (cid:98) ∆ , or
M ARKER returns F AIL due to a request to a page not in the cache when the cache has k marked pages.
By Lemma B.2 the former occurs with probability at most ˆ ε , and by Lemma B.3, the latter occurs with probability
O (ˆ ε ) .
The lemma follows by a union bound.
Finally, we are ready to prove the competitive ratio of the algorithm.
Lemma B.5.
The competitive ratio of T WO S TRIKES UA is O (log(1 /ε )) .
Proof.
We need to show that the expected number of evictions in a phase is O (∆ log(1 /ε )) .
Since (cid:98) ∆ ≤ 2∆ in each epoch and doubles between consecutive epochs in the same phase, it suffices to show that the expected number of page swaps in an epoch is O ( (cid:98) ∆ log(1 /ε )) .
By Lemma B.1, the expected number of evictions in all blocks of a single epoch satisfying ˆ ε ≥ ε 2 is bounded by O ( (cid:98) ∆ log(1 /ε )) .
By Lemma B.4, for any block with ˆ ε < ε , the probability that the algorithm starts a new block is
O (ˆ ε ) .
Thus, the expected number of swaps due to all blocks satisfying ˆ ε < ε 2 is at most
[Equation]
B.2 Caching Lower Bound
Theorem B.6.
Any (randomized) algorithm for caching with ε -accurate suggestions is Ω(log(1 /ε )) - competitive.
In our lower bound construction, we will consider the following prediction model: at each time t , with probability ε (independently of the past), the algorithm receives a good prediction (i.e., it is told the FIF page in its cache).
With probability 1 − ε , it does not receive any prediction at all.
This prediction model is stronger than ε -accurate suggestions, because any algorithm, given the former, can generate the latter by choosing a page uniformly at random from its cache in the 1 − ε case.
Thus, a lower bound in this model also holds for the ε -accurate prediction model.
Proof.
Let n = k + 1 and consider the sequence that generates each request uniformly at random among the k + 1 pages.
Set ε = 1 k ln k .
A phase is defined as a maximal contiguous subsequence of requests that contains exactly k distinct pages.
Consider an arbitrary phase and let X be the random variable denoting its length.
Note that E [ X ] is the expected number of times we would need to sample from a uniform random variable over a space of size k + 1 until we obtain k distinct outcomes.
By a slight modification of the coupon collector analysis, we can show that X =
Θ( k log k ) with constant probability.
Now partition the input into groups of 3 consecutive phases (starting at the beginning), and consider any such group.
Notice that every phase contains all but one of the k + 1 pages, and that missing page is the first page requested in the subsequent phase.
So for each page p suggested to the algorithm during the first phase, p is either requested in the second phase, or p is the first request of the third phase.
Furthermore, the probability that the algorithm does not receive any good suggestions during the second or third phase is (1 − ε ) Θ
( k log k )
= Θ(1) .
So overall in this group, with constant probability, the algorithm only receives good suggestions in the first phase, and these suggestions do not reveal anything about the third phase (except for possibly the first request).
So when serving the third phase of the group, the algorithm incurs a miss at every step with probability 1 / ( k + 1) , for an expected cost of Ω(log k ) to serve the group.
On the other hand, the optimal solution can serve each phase by evicting the single page that does not appear in that phase, thereby incurring O (1) cost per group.
C Missing Proofs from SectionC.1 Analysis of S ET -H EDGE and C OVER -H EDGE
Proof of Theorem 3.1.
Fix any instance of online set cover and an optimal solution OPT for it.
Let
ALG t be the solution of the S ET -H EDGE algorithm after covering e t .
Consider the potential function
[Equation]
the cost of optimal sets not already picked by the algorithm by time t (and scaled by 2 /ε ).
If ∆Φ t and ∆ c ( ALG t ) denote the change in potential and the algorithm’s cost due to sets picked at time t , we claim
[Equation]
and because Φ t is always non-negative, this shows that the total expected cost of sets picked by the algorithm is at most Φ
= (2 /ε ) ·
c ( OPT ) .
To prove (1), condition on H t − 1 : if e t is already covered by ALG t − 1 we have ∆Φ t = ∆ c ( ALG t ) = 0 .
Else if e t is not previously covered, ∆ c ( ALG t )
=
c ( g t ) c
( s t ) · c
[Equation]
s t ) + [Equation] 1 − c ( g t ) c
( s t ) )
· c ( g t ) ≤ 2 c ( g t ) .
The potential change is
[Equation]
By the ε -accuracy condition, the probability values sum to at least ε .
Hence E [∆Φ t | H t − 1 ] ≤ − (2 /ε ) ·
c ( g t ) · ε .
So (1) holds irrespective of H t − 1 (and hence unconditionally).
Proof of Theorem 3.2.
The proof closely mimics that of Theorem 3.1; the potential is now
[Equation]
This is clearly non-negative (by monotonicity), and starts off at Φ 0 ≤ (2 /ε ) ·
c ( x ∗ ) .
Again it suffices to show that E [∆Φ t + ∆ c
( ALG t )] ≤ 0 .
First, a direct calculation shows
[Equation]
To bound the expected potential decrease, for any vector v , setting x t ← x t − 1 ∨ v decreases the potential by
[Equation]
which is non-negative by submodularity.
Let E t be the event that p t ≤ x ∗ , and let F t be the event that we make the choice of setting x t ← x t − 1 ∨ p t .
If both events happen, we have c ( x ∗ ∨ ( x t − 1 ∨ p t ))
=
c ( x ∗ ∨ x t − 1 ) , and the expression above becomes
[Equation]
Hence
[Equation]
Moreover, the two events are independent.
By the ε -accuracy property, we know that Pr[ E t |
H t − 1 ] ≥ ε .
Finally, substituting the probability of F t from the algorithm description, we get
E [∆Φ t + ∆ c ( ALG t ) | H t − 1 ] ≤ 0 , which proves the claim.
C.2 Separable Objective Functions
We consider the same setting as Section 3.2, with the only difference being that instead of requiring that the objective function c : R d → R ≥ 0 is submodular, in this section, we require it to be separable.
In particular, we assume there exist functions c 1 , . . .
, c d : R → R ≥ 0 such that every c i is monotone, and for all x ∈ R d , c ( x ) =
(cid:80) i c i ( x i ) .
Note that this implies c itself is monotone.
Recall the C OVER -H
EDGE algorithm, given a subset K t and suggestion p t :
Let g t be the minimum-cost increment—i.e., g t ← arg min { c ( x t − 1 ∨ g ) | g ∈ K t } .
Then set x t ← x t − 1 ∨ p t with probability c ( x t − 1 ∨ g t ) − c ( x t − 1 ) c ( x t − 1 ∨ p t ) − c ( x t − 1 ) , and x t ← x t − 1 ∨ g t otherwise.
We claim that it is still 2 /ε -competitive in this setting.
Note that when c is separable, for any vectors x, v ∈ R d , we have c ( x ∨ v ) =
(cid:80) i c i
( x i ∨ v i ) .
Theorem C.1.
Given ε -accurate suggestions, the C OVER -H EDGE algorithm is 2 /ε -competitive for any generalized covering problem where the objective is separable.
Proof.
Like that of Theorem 3.2, this proof closely mimics that of Theorem 3.1.
The potential is the same as the one used to prove Theorem 3.2:
[Equation]
This is non-negative (by monotonicity) and starts off at Φ 0 ≤ (2 /ε )
· c ( x ∗ ) .
Again it suffices to show that E [∆Φ t + ∆ c
( ALG t )] ≤ 0 .
To bound the expected potential decrease, for any vector v , setting x t ← x t − 1 ∨ v decreases the potential by
[Equation]

  
[Equation] which is non-negative since x ∗
i ≥ x t −
i ∨ v i implies x ∗ i ≥ x t − 1 i , and every c i is monotone.
The remainder of the proof is identical to that of Theorem 3.2.
C.3 Properties of Generalized Covering Problems
The component-wise maximum property is satisfied for covering programs (i.e., where the constraints are a ⊺ x ≥ b , and all entries of a, b are non-negative).
However, we now show that the property is also satisfied when a has one negative coordinate.
Fact C.2.
Suppose a ∈ R n , b ∈ R , and consider the set K = { x : a ⊺ x ≥ b, x ≥ 0 } .
Assume K contains at least one non-zero vector.
Then K is closed under max
if and only if a has at most one negative coordinate.
Proof.
We first prove the backward direction.
Let x, y ∈ R n satisfy a ⊺ x ≥ b and a ⊺ y ≥ b , let z
= x ∨ y .
If a has no negative coordinates, then clearly a ⊺ z ≥ b .
Now suppose there exists i such that a i < 0 .
Then we have
[Equation]
which implies a ⊺ z ≥ b , as desired.
For the forward direction, if n = 1 , the statement is trivial.
So for contradiction, without loss of generality, we assume a 1 , a 2 < 0 .
Let α i = − a
i , N = { i : a i < 0 } , and P = { i : a i > 0 } .
Now the condition a ⊺ x ≥ b is equivalent to
[Equation]
Consider the following cases:
P = ∅ :
In this case, if b ≥ 0 , then the zero vector is the only one that could possibly satisfy (2), contradicting the assumption that K contains at least one non-zero vector.
If b < 0 , then consider u, v ∈ R n with all zeroes except u 1 = − b/α 1 and v 2 = − b/α 2 .
Then w = u ∨ v does not satisfy (2), since the left-hand side is − b − b + b = − b > 0 while the right-hand side is 0 .
P ̸
= ∅ : Define u, v ∈ R n such that the following conditions hold: u i = v i = 0 for all i ∈ N \ { 1 , 2 } , u i = v i for all i ∈ P , ( u 1 , u 2 ) = ( ε/α 1 , 0) , ( v 1 , v 2 ) = (0 , ε/α 2 ) , and (cid:80) i ∈ P a i u i =
(cid:80)
i ∈ P
a i v i = b + ε for some arbitrary ε > | b | (so b + ε > 0 ). Then w = u ∨ v does not satisfy (2), since the left-hand side is ε + ε + b = b
+ 2 ε while the right-hand side is b + ε and ε > 0 .
C.4 Lower Bound for Set Covering
Theorem C.3.
Any algorithm for online set cover with ε -accurate suggestions is Ω(1 /ε )
-competitive, even for the fractional case (or allowing randomization).
As we did for the proof of Theorem B.6, we will consider the following prediction model: at each time t (independently of the past), the algorithm receives a good prediction (i.e., a set included in the optimal solution) with probability ε .
With probability 1 − ε , it does not receive any prediction at all.
Again, the algorithm can generate predictions on its own in the 1 − ε case.
Proof.
Within 1 /ε steps, there is a constant probability that the algorithm receives no suggestion.
So we define a sequence of 1 /ε requested elements as follows: the first element e 1 is contained in 2 1 /ε sets.
Each subsequent element e t is contained in exactly half of the sets that contain e t − 1 , chosen uniformly at random.
In expectation, the algorithm spends a total of 1 / 2 on sets that contain e t and do not contain e t ′ for any t ′ > t .
Since these spent amounts are disjoint, over 1 /ε steps, the algorithm spends log(2 1 /ε ) / 2 = ε/ 2 in expectation, while an optimal solution spends 1 by picking the single set containing 1 /ε elements.
We can scale this construction by making disjoint copies of this instance, and in each copy, there is a constant probability that the algorithm spends Ω(1 /ε ) while the optimal solution spends 1.