• No results found

Practical traits of the algorithm

In this section, we discuss some traits that make the algorithm more practical. In particular, we prove that our algorithm makes the errors of the predictor only have local negative effect and prevent them from propagating further. Subsequently, we show that common heuristic approaches, such as LRU, can be used as predictors in our framework. This allows us to combine their predictive power with robust guarantees when they fail.

Locality. The guarantee in Theorem 4.3 bounds the competitive ratio as a function of the quality of the prediction. One potential concern is that if the predictions have of a small number of very large errors, then the applicability of Predictive Marker may be quite limited.

Here we show that this is not the case. Due to the phase-based nature of the analysis, the algorithm essentially “resets” at the end of every phase, and therefore the errors incurred one phase do not carry over to the next. Moreover, the competitive ratio in every phase is bounded by O(Hk).

Formally, for any sequence σ, we can define phases that consist of exactly

kdistinct elements. LetCL(r, σ)be the number of clean elements in phase r of

sequence σ, and let η`,r(h, σ)denote the error of predictor h restricted only to

elements occurring in phase r.

competitive ratio of Predictive Marker PM at sequence σ when assisted by a predictor h is at most: CRPM,` ≤ P rCL(r, σ) · min 1+ 2S`(η`,r(h, σ), 2Hk P rCL(r, σ)

Proof. The proof follows directly from Lemma 4.4 and applying Jensen’s inequal- ity only within the chains of the phase (instead of also across phases as we did in

Theorem 4.3). 

This theorem illustrates a very nice property of our algorithm. If the predictor his really bad for a particular chunk of time (has big locality in its errors) then the clean chains of the corresponding badly predicted phases will contribute the second term (the logarithmic worst-case guarantee) but the other phases will provide enhanced performance utilizing the predictor’s advice. In this way, the algorithm adapts to the quality of the predictions, and bad errors do not propagate beyond the end of a phase. This quality is useful in caching where most patterns are generally well predicted but there are few unforeseen sequences.

Robustifying LRU. Another practical property of our algorithm is that it can seamlessly incorporate heuristics known to perform well in practice. In particular, the popular Least Recently Used (LRU) algorithm can be expressed within the Predictive Marker framework. Consider the following predictor h: when an element σiarrives at time i, h predicts next arrival time h(σi)= −i.1

Note that, by doing so, at any point of time, among the elements that are in the cache, the element predicted the furthest in the future is exactly the one that

1If we prefer positive numbers in the predictions, we can select h(σ

i)= T − i where T is the

has appeared the least recently. Also note that any marked element needs to have arrived later than any unmarked element. As a result, if we never switched to random evictions (or had k in the RHS of line 17 in Algorithm 5), the Predictive Marker algorithm assisted with the LRU predictor is exactly the LRU algorithm.

The nice thing that comes from this observation is that we can robustify the analysis of LRU. LRU, and its variants like LRU(2), tend to have very good empirical performance as using the recency of requests is a good predictor about how future requests will arise. However, the worst-case guarantee of LRU is unfortunately of the order of k since it is after all a deterministic algorithm. By expressing LRU as a predictor in the Predictive Marker framework and using

a switching point of Hk for each clean chain, we exploit most of this predictive

power while also guaranteeing a logarithmic worst-case bound on it.

4.6

Remarks

More information about the paper. The results presented in this chapter are joint work with Sergei Vassilvitskii [95]. In the paper, we also discuss further how to trade off worst-case competitiveness for enhanced robustness by adapting the switching threshold. Moreover, we show a general construction that can combine an algorithm that is robust with one that is worst-case competitive via multiple restarts of the algorithm. Although this construction is not very practical, it suggests that the biggest bottleneck in designing algorithms with our aforementioned desiderata lies in deriving algorithms that are robust, i.e. gracefully degrade with the error of the predictor. Finally, we show that our algorithm has good empirical performance, outperforming both LRU and Marker

even without any modification in very simple datasets.

More generally on online algorithms with predictions. Our work has initi- ated a line of work that studies the design of online algorithms that are aided with a machine learned predictor and want to obtain improved guarantees when the prediction is accurate while being robust to imperfections. Follow-up works focus on dealing with such imperfections in predictions in online settings such as ski rental or job scheduling by Purohit et al. [107] and Mitzenmacher [99].

Beyond online algorithms, there have been a few works nicely injecting pre- dictions in decision-making tasks. Medina and Vassilvitskii [97] show how to use such predictions in revenue optimization. Kraska et al. [84] demonstrate em- pirically that introducing machine learned components to classical algorithms (in their case index lookups) can result in significant speed and storage gains. Finally, Rakhlin and Sridharan [110] show how to enhance online learning guarantees when the losses can be predicted in a relatively accurate way.

CHAPTER 5

DYNAMIC PRICING IN RIDESHARING

Another place where state becomes important is ridesharing. When Uber or Lyft match a particular driver to a customer, the driver moves with the customer to her desired destination. This changes the underlying state of the system and may create an undesired spatial mismatch between supply (drivers) and demand (customers). To deal with this mismatch, the platforms have at their disposal some control levers such as pricing that can help them modulate the process.

Classical competitive analysis paradigms can apply in the above scenario but often disregard crucial complexities that are first-order effects in these systems. One such paradigm is the k-server problem (it extends the caching problem which we discussed in the previous chapter). There, requests arrive in different locations and the platform needs to send servers to deal with them aiming to minimize the aggregate delay. This captures the spatial component of ridesharing systems but optimizes a largely irrelevant objective: platforms typically do not aim to serve all users under high stress. Instead they care about objectives such as throughput (how many customers got served), social welfare (how much value their service created to society), or revenue (how much money the platform gained). Another classical competitive analysis paradigm is bipartite matching which also captures an important effect: matching a customer to a driver makes the latter unavailable to future requests. However, this paradigm ignores future network effects as the driver will eventually become again available to serve demand possibly in a different location. Finally, most competitive analysis results target worst-case arrival sequences, while in a ridesharing system there is much well-behaved stochasticity.

In this chapter, we depart from competitive analysis and develop a general queueing-theoretic framework capturing the stochasticity in user requests. Fo- cusing on the steady-state performance of the system, we obtain approximation guarantees in such ridesharing systems via appropriately pricing different rides. Our queueing-theoretic approach for the setting is motivated by classical works on controls in state-dependent stochastic processes. This approach allows us to model most of the first-order effects in these systems such as the ones we discussed in the previous paragraph. Interestingly, our guarantees are also parametric and become better as the ratio of drivers to locations increases; they achieve asymptotic optimality and provide effective approximation guarantees for the real parameters of the systems. In particular, consider a ridesharing system with m drivers and n distinct locations (for instance, corresponding to Uber’s Hexagonal Hierarchical Spatial Index). In this system, the approximation

guarantee of our approach is 1+ (n − 1)/m, which is typically very close to 1 as

there are significantly more drivers than locations in these systems.