Safety in Contextual Linear Bandits

Abbas Kazerouni Stanford University

Mohammad Ghavamzadeh Adobe Research

Benjamin Van Roy Stanford University

Abstract Safety is a desirable property that can immensely increase the applicability of learning algorithms in real-world decision-making problems. It is much easier for a company to deploy an algorithm that is safe, i.e., guaranteed to perform at least as well as a baseline. In this paper, we study the issue of safety in contextual linear bandits that have application in many different fields. We develop a safe contextual linear bandit algorithm, called conservative linear UCB (CLUCB), that simultaneously minimizes its regret and satisfies the safety constraint, i.e., maintains its performance above a fixed percentage of the performance of a baseline strategy, uniformly over time. We prove an upper-bound on the regret of CLUCB and show that it can be decomposed into two terms: 1) an upper-bound for the regret of the standard linear UCB algorithm that grows with the time horizon and 2) a constant (does not grow with the time horizon) term that accounts for the loss of being conservative in order to satisfy the safety constraint. We empirically show that our algorithm is safe and validate our theoretical analysis.

1

Introduction

Many problems in science and engineering can be formulated as a decision-making problem under uncertainty. Although many learning algorithms have been developed to find a good policy/strategy for these problems, most of them do not provide any guarantee that their resulting policy will perform well, when it is deployed. This is a major obstacle in using learning algorithms in many different fields, such as online marketing, health sciences, and finance. Therefore, developing learning algorithms with safety guarantees can immensely increase the applicability of learning in solving decision-making problems. A policy is considered to be safe, if it is guaranteed to perform at least as well as a baseline. The baseline can be either a baseline value or the performance of a baseline strategy. It is important to note that since the policy is learned from data, and data is often random, the generated policy is a random variable, and thus, the safety guarantees are in high probability. Safety can be studied in both offline and online scenarios. In the offline case, the algorithm learns the policy from a batch of data, usually generated by the current strategy(ies) of the company, and the question is whether the learned policy will perform as well as the current strategy or no worse than a baseline value, when it is deployed. This scenario has been recently studied heavily in both model-based (e.g., [8]) and model-free (e.g., [3, 14, 15, 13, 12, 11, 6]) settings. In the online scenario, the algorithm learns a policy while interacting with the real system. Although online algorithms will eventually learn a good or an optimal policy, there is no guarantee for their performance along the way, especially at the very beginning, when they explore a lot. Thus, in order to guarantee safety in online algorithms, it is important to control their exploration and make it more conservative. Consider a manager that allows our learning algorithm to run together with her company’s current strategy (baseline policy), as long as it is safe, i.e., the loss incurred by letting a portion of the traffic handled by our algorithm (instead of by the baseline policy) does not exceed a certain threshold. Although we are confident that our algorithm will eventually perform at least as well as the baseline strategy, it should be able to remain alive (not terminated by the manager) long enough for this to happen. Therefore, we should make it more conservative in a way not to violate the manager’s safety constraint. This setting has been studied in multi-armed bandits (MAB) [16]. Wu et al. [16] considered the baseline policy as a fixed arm in MAB, formulated safety using a constraint defined based on the mean of the baseline arm, and modified the UCB algorithm [2] to satisfy this constraint. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain.

In this paper, we study the notion of safety in contextual linear bandits, a setting that has application in many different fields including online personalized ad recommendation. We first formulate safety in this setting, as a constraint that must hold uniformly in time. Our goal is to design learning algorithms that minimize regret under the constraint that at any given time, their expected sum of rewards should be above a fixed percentage of the expected sum of rewards of the baseline policy. This fixed percentage depends on the amount of risk that the manager is willing to take. We then propose an algorithm, called conservative linear UCB (CLUCB), that satisfies the safety constraint. At each round, CLUCB plays the action suggested by the standard linear UCB (LUCB) algorithm (e.g., [5, 9, 1, 4, 10]), only if it satisfies the safety constraint for the worst choice of the parameter in the confidence set, and plays the action suggested by the baseline policy, otherwise. We also prove an upper-bound for the regret of CLUCB, which can be decomposed into two terms. The first term is an √ upper-bound on the regret of LUCB that grows at the rate T log(T ) and the second term is constant (does not grow with the horizon T ) and accounts for the loss of being conservative in order to satisfy the safety constraint. Finally, we report experimental results that show CLUCB behaves as expected in practice and validate our theoretical analysis.

2

Problem Formulation

In this section, we first review the standard linear bandit setting and then introduce the conservative linear bandit formulation considered in this paper. 2.1 Linear Bandits In the linear bandit setting, at any time t, the agent is given a set of (possibly) infinitely many actions At , where each action a ∈ At is associated with a feature vector φta ∈ Rd . At each round t, the agent should select an action at ∈ At , and upon selecting it, observes a random reward Yt generated as Yt = hθ∗ , φtat i + ηt , ∗



d

, φtat i 2

(1)

rat t

where θ ∈ R is an unknown parameter, hθ = is the expected reward of action at at time t, i.e., rat t = E[Yt ], and ηt is a conditionally σ -sub-Gaussian random noise. Note that the above formulation contains time-varying action set and time-dependent feature vectors for each action, and thus, includes the linear contextual bandit setting. In linear contextual bandit, if we denote by xt , the state of the system at time t, the time-dependent feature vector φta for action a will be equal to φ(xt , a), the feature vector of state-action pair (xt , a). We also make the following standard assumption on θ∗ and feature vectors: Assumption 1. There exist B, D ≥ 0 such that kθ∗ k2 ≤ B and hθ∗ , φta i ∈ [0, D], ∀t and ∀a ∈ At . We define B = {θ ∈ Rd : kθk2 ≤ B} and Φ = {φ ∈ Rd : hθ∗ , φi ∈ [0, D]} to be the parameter space and feature space, respectively. Obviously, if the learner knows θ∗ , at each round t, she will choose the optimal action a∗t = arg maxa∈At hθ∗ , φta i. Since θ∗ is unknown, the goal of the learner is to maximize her cumulative PT expected reward after T rounds, t=1 hθ∗ , φtat i, or equivalently, to minimize its (pseudo)-regret RT =

T T X X hθ∗ , φta∗t i − hθ∗ , φtat i, t=1

(2)

t=1

which is the difference between the sum of expected rewards of the optimal and learner’s strategies. 2.2 Conservative Linear Bandits The conservative linear bandit setting is exactly the same as linear bandit, except that there exists a baseline policy πb (the company’s strategy) that at each time t, selects the action bt ∈ At and incurs the expected reward rbtt = hθ∗ , φtbt i. We assume that the expected reward of the actions taken by the baseline policy, rbtt , are known. This is often a reasonable assumption, since we usually have access to a large amount of data generated by the baseline policy, as it’s our company’s strategy, and thus, have a good estimate of its performance. Another difference between the conservative and standard linear bandit settings is the performance constraint, which is defined as follows: Definition 1 (Performance Constraint). At each time t, the difference between the performances of the learner and the baseline policy should not exceed a pre-defined fraction α ∈ (0, 1) of the baseline performance. This constraint may be written more formally as t X i=1

rbi i −

t X i=1

rai i ≤ α

t X

rbi i

or equivalently as

i=1

t X i=1

2

rai i ≥ (1 − α)

t X i=1

rbi i .

Algorithm 1 CLUCB Input: α, A, B Initialize: S0 = ∅, S0c = ∅, z0 = 0 ∈ Rd , and C1 = B for t = 1, 2, 3, · · · do Find (a0t , θet ) = arg max(a,θ)∈At ×Ct hθ, φta i Find Lt = minθ∈Ct hθ, zt−1 + φta0 i P Ptt if Lt + i∈S c rbi i ≥ (1 − α) i=1 rbi i then t−1 Play at = a0t and observe reward Yt defined by (1) c Set zt = zt−1 + φtat , St = St−1 ∪ t, and Stc = St−1 Given (at , Yt ), update the confidence set Ct+1 according to (3) else Play at = bt and observe reward Yt defined by (1) c Set zt = zt−1 , St = St−1 , Stc = St−1 ∪ t, and Ct+1 = Ct end if end for

The parameter α ∈ (0, 1) controls how conservative the learner should be. Small values of α show that only small losses are tolerated, and thus, the learner should be overly conservative, whereas large values of α indicate that the manager is willing to take risk, and thus, the learner can explore more and be less conservative. Given a value of α, the goal of the learner is to select her action in a way to both minimize her regret (2) and satisfy the performance constraint (1).

3

A Conservative Linear Bandit Algorithm

In this section, we propose a linear bandit algorithm, called CLUCB, that is based on the optimism in the face of uncertainty principle, and given the value of α, both minimizes the regret (2) and satisfies the performance constraint (1). Algorithm 1 contains the pseudocode of CLUCB. At each round t, CLUCB uses the previous observations and builds a confidence set Ct that with high probability contains the unknown parameter θ∗ . It then selects the optimistic action a0t = argmax maxθ∈Ct hθ, φta i, which has the best performance among all the actions available in At , a∈At

within the confidence set Ct . In order to make sure that constraint (1) is satisfied, the algorithm plays the optimistic action a0t , only if it satisfies the constraint for the worst choice of the parameter θ ∈ Ct . To make this more precise, let St−1 be the set of rounds i before round t at which CLUCB has played c the optimistic action, i.e., ai = a0i . In other words, St−1 = {1, 2, · · · , t − 1} − St−1 is the set of rounds j before round t at which CLUCB has followed the baseline policy, i.e., aj = bj . In order to guarantee that it does not violate constraint (1), at each round t, CLUCB plays the optimistic action, i.e., at = a0t , only if zt−1

min

h X

θ∈Ct

z X}| { t i X

+ θ, φiai + hθ, φta0t i ≥ (1 − α) rbi i ,

rbi i

c i∈St−1

i=1

i∈St−1

and plays the baseline action, i.e., at = bt , otherwise. In the next section, we will describe how CLUCB constructs and updates the confidence sets Ct . To build the confidence sets, To build the confidence sets, we first calculate the square estimate of the unknown parameter,  least P i given the data that have been observed so far (φai , Yi ) i∈St−1 , as θbt = argmin i∈St−1 (Yi − θ∈B

hθ, φiai i)2 , and then update the confidence set as v u X  2 o n u Ct = θ ∈ Ct−1 : t hθ, φiai i − hθbt , φiai i ≤ β(mt−1 , δ) ,

(3)

i∈St−1

where mt−1 = |St−1 | is the number of optimistic actions played prior to round t, δ ∈ (0, 1) is the desired confidence level, and 2

β(mt , δ) = 16dσ log

 2(m

t−1

δ

+ 1) 

+

2 mt−1 + 1



r 16D +

8σ 2 log

4(mt−1 + 1)2  . δ

Note that (3) defines a decreasing sequence of confidence sets, i.e., C1 ⊇ C2 ⊇ C3 ⊇ · · · . 3

4

Analysis of the Algorithm

The proofs for all the following results can be found in the long version of the paper [7]. Proposition 1 shows that the confidence sets (3) contain the true parameter θ∗ with high probability. Proposition 1. For any δ > 0 and with Ct defined in (3), we have P[θ∗ ∈ Ct , ∀t ∈ N] ≥ 1 − 2δ. Proposition 1 is a special case of Proposition 6 in [10] for the family of linear functions and we omit its proof here. It indicates that CLUCB satisfies the performance constraint (1) at any time t w.p. at least 1 − 2δ. This is because at any time t, CLUCB ensures that the constraint (1) holds for all θ ∈ Ct . Now, we turn to prove a regret bound for the CLUCB algorithm. Let ∆tbt = rat ∗t − rbtt be the difference between the expected rewards of the optimal and baseline actions at time t. We call ∆tbt the baseline gap at time t. It indicates how sub-optimal the action suggested by the baseline policy is at time t. We make the following assumption on the performance of the baseline policy πb . Assumption 2. There exist 0 ≤ ∆l ≤ ∆h and 0 < rl < rh such that at each round t, ∆l ≤ ∆tbt ≤ ∆h

rl ≤ rbtt ≤ rh .

and

(4)

The following theorem provides a regret bound on the performance of CLUCB algorithm. Theorem 2 (Main Result). With probability at least 1 − 2δ, the CLUCB algorithm satisfies the performance constraint (1) for all t ∈ N, and has the following regret bound on the regret:  2BT  √ ∆h +K , RT (CLU CB) ≤ 30Ddσ T log δ αr (αr l l + ∆l ) √ 

 where K = O Ddσ log

B/δDdσ 2

αrl +∆l

(5)

depends only on the parameters of the problem.

√ The first term in the regret bound is the regret of LUCB, which grows at the rate T log(T ). The second term accounts for the loss incurred by being conservative in order to satisfy the performance constraint (1). Our results indicate that this loss does not grow with time (since CLUCB will be conservative only in a finite number of times). This improves over the regret bound derived in [16] for the MAB setting, where the regret of being conservative grows with time. However, the multiplicative constants in our regret bound are larger then those in the regret bound of [16]. Furthermore, the regret bound of Theorem 2 clearly indicates that CLUCB’s regret is larger for smaller values of α. This perfectly matches the intuition that the agent must be more conservative, and thus, suffers higher regret for smaller values of α. Theorem 2 also indicates that CLUCB’s regret is smaller for smaller values of ∆h , because when the baseline policy πb is close to optimal, the algorithm does not lose much by being conservative.

5

Experiments

average regret per period

We considered a set of 100 arms, each having a feature vector in R10 . Each component of the fea1.5 ture vectors is selected uniformly at random in LUCB ∗ CLUCB, α = 0.01 [−1, 1] and the parameter θ is randomly drawn  CLUCB, α = 0.05 CLUCB, α = 0.2 from N 0, 10I10 such that the mean reward as1 sociated to each arm is positive. The observation noise is also generated independently from N (0, 4) and the mean reward of the baseline action µ0 is 0.5 set equal to the average of the performances of the second and third best arm. Figure 1 depicts the expected reward per period (i.e., Rtt ) of LUCB and 0 CLUCB for different values of α over a horizon of 0 1 2 3 4 5 6 7 time T = 7 × 104 . Each plot is generated taking average x 10 over 20 random realizations of the scenario. As can Figure 1: Average regret of LUCB and CLUCB be seen here, CLUCB plays conservatively at the for different values of α. beginning which incurs a regret larger than LUCB. However, the regret gap between CLUCB and LUCB vanishes over time as CLUCB learns to play the optimal action. As anticipated, Fig. 1 also suggests that as α gets larger the performance of CLUCB converges faster to that of LUCB. On the other hand in our simulations, CLUCB always satisfies the constraints in (1) for all values of α whereas LUCB violates the safety constraints at an average of 26561 time steps when α = 0.01. This confirms our theoretical result that CLUCB guarantees the safety constraints at all time while maintaining a regret bound very close to that LUCB. 4

4

References [1] Y. Abbasi-Yadkori, D. Pál, and C. Szepesvári. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pages 2312–2320, 2011. [2] P. Auer, N. Cesa-Bianchi, and P. Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning Journal, 47:235–256, 2002. [3] L. Bottou, J. Peters, J. Quinonero-Candela, D. Charles, D. Chickering, E. Portugaly, D. Ray, P. Simard, and E. Snelson. Counterfactual reasoning and learning systems: The example of computational advertising. Journal of Machine Learning Research, 14:3207–3260, 2013. [4] W. Chu, L. Li, L. Reyzin, and R. Schapire. Contextual bandits with linear payoff functions. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pages 208–214, 2011. [5] V. Dani, T. Hayes, and S. Kakade. Stochastic linear optimization under bandit feedback. In COLT, pages 355–366, 2008. [6] N. Jiang and L. Li. Doubly robust off-policy value evaluation for reinforcement learning. In Proceedings of the Thirty-Third International Conference on Machine Learning, 2016. [7] A. Kazerouni, M. Ghavamzadeh, and B. V. Roy. Conservative contextual linear bandit. In "http: // web. stanford. edu/ ~abbask/ consBandit. pdf ". [8] M. Petrik, M. Ghavamzadeh, and Y. Chow. Safe policy improvement by minimizing robust baseline regret. In Advances in Neural Information Processing Systems, 2016. [9] P. Rusmevichientong and J. Tsitsiklis. Linearly parameterized bandits. Mathematics of Operations Research, 35(2):395–411, 2010. [10] D. Russo and B. Van Roy. Learning to optimize via posterior sampling. Mathematics of Operations Research, 39(4):1221–1243, 2014. [11] A. Swaminathan and T. Joachims. Batch learning from logged bandit feedback through counterfactual risk minimization. Journal of Machine Learning Research, 16:1731–1755, 2015. [12] A. Swaminathan and T. Joachims. Counterfactual risk minimization: Learning from logged bandit feedback. In Proceedings of The 32nd International Conference on Machine Learning, 2015. [13] G. Theocharous, P. Thomas, and M. Ghavamzadeh. Building personal ad recommendation systems for life-time value optimization with guarantees. In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, pages 1806–1812, 2015. [14] P. Thomas, G. Theocharous, and M. Ghavamzadeh. High confidence off-policy evaluation. In Proceedings of the Twenty-Ninth Conference on Artificial Intelligence, 2015. [15] P. Thomas, G. Theocharous, and M. Ghavamzadeh. High confidence policy improvement. In Proceedings of the Thirty-Second International Conference on Machine Learning, pages 2380–2388, 2015. [16] Y. Wu, R. Shariff, T. Lattimore, and C. Szepesvári. Conservative bandits. In Proceedings of The 33rd International Conference on Machine Learning, pages 1254–1262, 2016.

5

Safety in Contextual Linear Bandits

for a company to deploy an algorithm that is safe, i.e., guaranteed to perform at ... Therefore, we should make it more conservative in a way not to violate the ... 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona .... We call ∆t bt the baseline gap at time t. It indicates how sub-optimal the action ...

320KB Sizes 4 Downloads 212 Views

Recommend Documents

Contextual Bandits with Stochastic Experts
IBM Research,. Thomas J. Watson Center. The University of Texas at Austin. Abstract. We consider the problem of contextual ban- dits with stochastic experts, which is a vari- ation of the traditional stochastic contextual bandit with experts problem.

Dynamic Clustering of Contextual Multi-Armed Bandits - Hady W. Lauw
Nov 7, 2014 - Second, in Section 3, we verify the effi- cacy of this approach through experiments on two real-life datasets, studying the appropriate number of ...

Dynamic Clustering of Contextual Multi-Armed Bandits - Hady W. Lauw
Nov 7, 2014 - With the rapid growth of the Web and the social media, users have to navigate a huge number of options in their .... The second dataset is on the online radio LastFM, where a set of users assign tags to a set of music artists. We ... a

Contextual Multi-Armed Bandits - Proceedings of Machine Learning ...
Department of Computer Science. University ... We want to design an online algorithm, which given a query in each ..... On the highest level, the main idea of the.

Modeling Contextual Agreement in Preferences
may be extra information, e.g., social network, to induce ...... distribution over item and user vectors with hyper-parameters, ..... First, its converged error is the.

Leveraging Side Observations in Stochastic Bandits
including content recommendation, Internet advertis- ing and clinical trials. ... cation of this scenario is advertising in social networks: a content provider ... net advertisement. The approach in both these works is to reduce a large number of arm

Contextual Advertising
Jun 18, 2011 - social networks alike embrace advertising as their preferred ..... 10Specifically, the intermediary determines the winner by ranking PPCi ∗ CTRi.

Opposing Effects of Contextual Surround in Human ...
Mar 3, 2010 - This work was partially supported by Ministry of Education, Culture, Sports, Science, and Technology Grants. 17022015, 18020033, and 20020033 ... with a uniform gray background. The A-B-B-A cycle was repeated three ...

Linear and Linear-Nonlinear Models in DYNARE
Apr 11, 2008 - iss = 1 β while in the steady-state, all the adjustment should cancel out so that xss = yss yflex,ss. = 1 (no deviations from potential/flexible output level, yflex,ss). The log-linearization assumption behind the Phillips curve is th

LNAI 3127 - Negation in Contextual Logic - Springer Link
1 Introduction. The aim of Formal Concept Analysis1 is among others to support human thin- king. Rudolf ... Dedekind (1831-1916) got the same concept while working on ideals of algebraic numbers. ..... A dicomplementation on the product of two 4 elem

A Model of Contextual Motivation in Physical Education
A context in which health en- hancement, via the ... health, interest and participation in PE has been shown to ..... opportunities to plan one's own activities) facets of a mastery ...... incentive for behavior emanating from within the individual,

Extracting Contextual Evaluativity
(§4) strongly support a compositional approach to contextual evaluativity inference. A simple com- ... Note that for this application, we may simplify the compositional picture and treat functors as .... 2http://developer.yahoo.com/search/.

Contextual learning induces an increase in the number ...
campus following behavioral training in a contextual fear conditioning (CFC) ..... Third, if the selected area within the CA1 cell layer exceeded 126 pixels (ca. 50 μm2, half of the ..... Academy of Sciences of the United States of America, 101,.

Contextual Contact Retrieval
relationship management software, the system may look-up contacts on your ... based on the user's context (e.g., the content of a displayed email message or ...

Watch Time Bandits (1981) Full Movie Online.pdf
Watch Time Bandits (1981) Full Movie Online.pdf. Watch Time Bandits (1981) Full Movie Online.pdf. Open. Extract. Open with. Sign In. Main menu.

Tighter Bounds for Multi-Armed Bandits with Expert Advice
Pittsburgh, PA 15213, USA. Abstract. Bandit problems are a ..... ally an apples-to-oranges comparison, as their work makes a strong probabilistic assumption on ...

Safety Bulletin - Chemical Safety Board
Program the defrost control sequence to automatically depressurize or bleed the coil upon ... In cases where ammonia may be released in an aerosolized form with lubricating oil from the refrigeration system, the flammable .... components (e.g., sucti

QUALITY AND SAFETY MONITORING IN DAIRY INDUSTRY ...
QUALITY AND SAFETY MONITORING IN DAIRY INDUSTRY NOTES 1.pdf. QUALITY AND SAFETY MONITORING IN DAIRY INDUSTRY NOTES 1.pdf. Open.

certificate programme in food safety
Certain strains of E. coli are very harmful to human beings. (d). Emergence of new food borne pathogens is always a concern. (e). Antioxidants are used for extending the shelf life of foods. 6. (a) Differentiate between Food Infection and. 6. Food In

Mixing Bandits: A Recipe for Improved Cold-Start ...
Last.fm (www.last.fm) and YouTube (www.youtube.com) al- low users to explicit declare their social connections, while others including Hulu (www.hulu.com), ...

pdf-1844\safety-pharmacology-in-pharmaceutical-development ...
pdf-1844\safety-pharmacology-in-pharmaceutical-develo ... al-and-post-marketing-surveillance-second-edition.pdf. pdf-1844\safety-pharmacology-in-pharmaceutical-develop ... val-and-post-marketing-surveillance-second-edition.pdf. Open. Extract. Open wi