appendix: the queue method: handling delay, heuristics...

4
Appendix for The Queue Method: Handling Delay, Heuristics, Prior Data, and Evaluation in Bandits Travis Mandel 1 , Yun-En Liu 1 , Emma Brunskill 2 , and Zoran Popovi´ c 1 1 Center for Game Science, Computer Science & Engineering, University of Washington 2 School of Computer Science, Carnegie Mellon University {tmandel, yunliu, zoran}@cs.washington.edu, [email protected] Stochastic Delayed Bandits Theorem 1. For algorithm 1 in the paper with any choice of procedure GETSAMPLINGDIST and any on- line bandit algorithm BASE, E [R T ] E R BASE T + N X i=1 Δ i E [S i,T ] (1) where S i,T is the number of elements pulled for arm i by time T , but not yet shown to BASE. Proof. Let T 0 be the number of times we have updated BASE. Note that since the samples fed to BASE were drawn iid according to the arm distributions and given on the arms it requested, the regret on these samples is R T 0 . Clearly T 0 T since for every sample we give BASE, we must have correspondingly taken a step in the true environment 1 . So the expected regret of only those steps in which we update BASE can be upper bounded by E R BASE T . (2) Now we must consider those timesteps for which we requested a sample but have not given it to BASE by time T . The number of such samples from arm i is ex- actly S i,T . So the regret on these timesteps is equal to N X i=1 S i,T X j=1 ρ i,j (3) Where ρ i,j denotes the regret of the j th sample not passed to BASE for arm i. Taking the expectation gives us: N X i=1 E S i,T X j=1 ρ i,j (4) Copyright c 2015, Association for the Advancement of Arti- ficial Intelligence (www.aaai.org). All rights reserved. 1 We also make the trivial assumption that the provided regret bound monotonically increases with T . By Wald’s equation this is: = N X i=1 E [S i,T ] E [ρ i,j ] (5) = N X i=1 E [S i,T i (6) Combining this with equation (2) gives us the re- quired bound. Theorem 2. For SDB, E [R T ] E R BASE T + max (7) in the online updating setting, and E [R T ] E R BASE T +2max (8) in the batch updating setting. 2 Proof. First note that on all timesteps B t τ max , since B 1 =1 and τ max 1 and for all t> 1, B t is equal to the empirical max delay. We will now show that in the online updating case, S i,t when running SDB never exceeds τ max . Clearly S i,0 =0 and so the bound holds in the base case. As- sume S i,t τ max at t, and we will prove it for t +1. Let I t denote the value of variable I in the SDB algorithm at time t. For arms j 6= I t ,the algorithm sets p jt =0 if S jt B t , and since B t τ max we cannot add samples such that S j,t+1 max . So only S It,t+1 can be greater than τ max . However, we know Q It must be empty, or 2 One small technical comment: Note that τmax =1 refers to the case of no delay, since the arm pulled at time t is observed at time t +1. It appears that Joulani et. al. 2013 used τmax =0 to denote no delay, so there is an off-by-one difference in τmax between our papers. This difference simply results in the SDB bound E h R BASE T i + i Δ i * max becoming E h R BASE T i + i Δ i * c(τmax + 1) if we use the definition of Joulani et al., so in the worst case the online updating regret bound of SDB differs by at most N from that of QPM-D. This very small difference in the bounds could be eliminated by simply modifying the update of B in SDB to calculate maximum delay minus one instead of maximum delay, with a negligible effect on the performance of the algorithm. The only remaining issue would be that the +N term would remain in the no-delay case since B is initialized to 1, however, the regret bounds would be the exactly same in the case of nonzero online updating delay.

Upload: others

Post on 28-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Appendix: The Queue Method: Handling Delay, Heuristics ...grail.cs.washington.edu/projects/bandit/banditappendix.pdfAppendix for The Queue Method: Handling Delay, Heuristics, Prior

Appendix forThe Queue Method: Handling Delay, Heuristics, Prior Data, and Evaluation

in BanditsTravis Mandel1, Yun-En Liu1, Emma Brunskill2, and Zoran Popovic11Center for Game Science, Computer Science & Engineering, University of Washington

2School of Computer Science, Carnegie Mellon University{tmandel, yunliu, zoran}@cs.washington.edu, [email protected]

Stochastic Delayed BanditsTheorem 1. For algorithm 1 in the paper with anychoice of procedure GETSAMPLINGDIST and any on-line bandit algorithm BASE,

E [RT ] ≤ E[RBASE

T

]+

N∑i=1

∆i E [Si,T ] (1)

where Si,T is the number of elements pulled for armi by time T , but not yet shown to BASE.

Proof. Let T ′ be the number of times we have updatedBASE. Note that since the samples fed to BASE weredrawn iid according to the arm distributions and givenon the arms it requested, the regret on these samplesis RT ′ . Clearly T ′ ≤ T since for every sample we giveBASE, we must have correspondingly taken a step in thetrue environment1. So the expected regret of only thosesteps in which we update BASE can be upper boundedby

E[RBASE

T

]. (2)

Now we must consider those timesteps for which werequested a sample but have not given it to BASE bytime T . The number of such samples from arm i is ex-actly Si,T . So the regret on these timesteps is equal to

N∑i=1

Si,T∑j=1

ρi,j (3)

Where ρi,j denotes the regret of the jth sample notpassed to BASE for arm i. Taking the expectation givesus:

N∑i=1

E

Si,T∑j=1

ρi,j

(4)

Copyright c© 2015, Association for the Advancement of Arti-ficial Intelligence (www.aaai.org). All rights reserved.

1We also make the trivial assumption that the provided regret bound monotonically

increases with T .

By Wald’s equation this is:

=N∑i=1

E [Si,T ]E [ρi,j ] (5)

=

N∑i=1

E [Si,T ] ∆i (6)

Combining this with equation (2) gives us the re-quired bound.

Theorem 2. For SDB,

E [RT ] ≤ E[RBASE

T

]+Nτmax (7)

in the online updating setting, and

E [RT ] ≤ E[RBASE

T

]+ 2Nτmax (8)

in the batch updating setting.2

Proof. First note that on all timestepsBt ≤ τmax, sinceB1 = 1 and τmax ≥ 1 and for all t > 1, Bt is equal tothe empirical max delay.

We will now show that in the online updating case,Si,t when running SDB never exceeds τmax. ClearlySi,0 = 0 and so the bound holds in the base case. As-sume Si,t ≤ τmax at t, and we will prove it for t+1. LetIt denote the value of variable I in the SDB algorithmat time t. For arms j 6= It,the algorithm sets pjt = 0 ifSjt ≥ Bt, and sinceBt ≤ τmax we cannot add samplessuch that Sj,t+1 > τmax. So only SIt,t+1 can be greaterthan τmax. However, we know QIt must be empty, or

2One small technical comment: Note that τmax = 1 refers to the case of no delay,

since the arm pulled at time t is observed at time t + 1. It appears that Joulani et. al. 2013used τmax = 0 to denote no delay, so there is an off-by-one difference in τmax between

our papers. This difference simply results in the SDB bound E[RBASE

T

]+

∑i ∆i ∗

cτmax becoming E[RBASE

T

]+

∑i ∆i ∗ c(τmax + 1) if we use the definition of

Joulani et al., so in the worst case the online updating regret bound of SDB differs by at mostN from that of QPM-D. This very small difference in the bounds could be eliminated bysimply modifying the update of B in SDB to calculate maximum delay minus one insteadof maximum delay, with a negligible effect on the performance of the algorithm. The onlyremaining issue would be that the +N term would remain in the no-delay case since B isinitialized to 1, however, the regret bounds would be the exactly same in the case of nonzeroonline updating delay.

Page 2: Appendix: The Queue Method: Handling Delay, Heuristics ...grail.cs.washington.edu/projects/bandit/banditappendix.pdfAppendix for The Queue Method: Handling Delay, Heuristics, Prior

variable I could not be set to point to it. But if we havemore than τmax samples assigned to It and not yet ob-served, one must have been assigned more than τmax

steps ago, meaning the delay must be greater than τmax,a contradiction. So SIt,t+1 also cannot be greater thanτmax.

So we have shown that Si,t ≤ τmax for all i and t inthe online updating case. Plugging into Theorem 1 andobserving that ∆i ≤ 1 gives us the stated bound.

Now we will show Si,t ≤ 2τmax in the batch updatecase. Note that in this case we refer to timesteps fromthe perspective of batches, where after every batch thetimestep increments. Let Bt be the value of SDB vari-able B at time t.

Assume Si,t ≤ 2τmax at t, and we will prove it fort+ 1.

For arm It, QIt must be empty before the batchbegins, so SIt,t = 0 since we have assumed all re-wards from each batch are observed upon its comple-tion. Since the batch size cannot be larger than τmax

it follows immediately that SIt,t+1 ≤ τmax ≤ 2τmax.We now consider arms i 6= It.

In the case where Si,t ≥ Bt and i 6= It, SDB setspi,t = 0, so Si,t+1 = Si,t ≤ 2τmax.

If i 6= It and Si,t < Bt, we know Bt < τmax, soSi,t < τmax. So since the batch size cannot be largerthan τmax, Si,t+1 ≤ Si,t + τmax < 2τmax.

So we have shown that Si,t ≤ 2τmax for all i and t inthe batch updating case. Plugging into Theorem 1 andobserving that ∆i ≤ 1 gives us the stated bound.

Lemma 1. In the mixed case where we update inbatches, but not all elements are guaranteed to returnbefore the end of the batch,

E [RT ] ≤ E[RBASE

T

]+N(τmax + 2βmax) (9)

for SDB, where βmax is the maximum size of a batch.

Proof. Observe that in this setting, while τmax is themaximum delay of a sample before it returns, the max-imum delay before we can process it is βmax + τmax,since there are at most βmax steps between when a sam-ple returns and when we can process it.

Let t refer to the timesteps on which updates occur.Let It denote the value of variable I in the SDB algo-rithm at time t, and similarly for B.

Clearly Si,0 = 0 and so the bound holds in the basecase. Assume Si,t ≤ 2βmax + τmax at time t, and wewill prove it for t+ 1.

In the case i = It, we know that QIt is empty attime t. Therefore, SIt,t ≤ τmax since if we have morethan τmax samples assigned to It and not yet observed,one must have been assigned more than τmax steps ago,meaning the delay must be greater than τmax, a contra-diction. The most we can put in before the next updateis βmax, so SIt,t+1 ≤ βmax + τmax ≤ 2βmax + τmax.

In the case where i 6= It and Si,t ≥ Bt, SDB setspi,t = 0, so Si,t+1 = Si,t ≤ 2βmax + τmax.

If i 6= It and Si,t < Bt, we knowBt < τmax+βmax,so Si,t < τmax + βmax. So since the batch size cannotbe larger than βmax, Si,t+1 ≤ Si,t + βmax < τmax +2βmax.

So we have shown that Si,t ≤ τmax + 2βmax for alli and t. Plugging into Theorem 1 and observing that∆i ≤ 1 gives us the stated bound.

Comparison to prior workJoulani et al. 2013 proposed a closely related algo-rithm QPM-D. If we extend their online updating anal-ysis to the batch updating cases, their algorithm hasa regret bound with a an additive term of Nτmax inthe online updating and batch updating settings andN(τmax + βmax) in the mixed setting. Hence we seethat SDB matches the bound of QPM-D in the onlineupdating setting, but the additive term worsens by atmost a factor of two when updates come in batches.Creating an algorithm that retains the bound of QPM-D in the batch case but also retains most of the empir-ical benefit of SDB is an important direction for futurework.

Delay with Online Updating resultsDue to space limitations, we were unable to includeboth the batch updating and online updating results inour paper.

The online updating case is relevant in many situa-tions, and the comparison between SDB and QPM-Dis a bit fairer because both possess the same theoreticalguarantees in this case. Below we repeat the same ex-periments as in the batch case, the only difference beingthat each algorithm can update its distribution after eachstep instead of in batches.3

Figures 1a-1f show the results running SDB in theonline updating case in a variety of simulations (see pa-per for explanations of the environments used). Fig-ure 2 gives the results on actual data using our unbiasedqueue-based estimator. We see much the same resultsas we did in the batch updating setting, showing goodempirical performance in a variety of scenarios. Onenotable difference is that in the UCB figures (1d and1e) we see that SDB has essentially “smoothed” outperformance, eliminating the the troughs of very poorperformance. The reason for this is that in the onlinecase, if the heuristic chooses an arm to pull, SDB willinitially allow it to put full probability mass on that arm,but then smoothly decrease the amount of probability itis allowed place on that arm, shift the remainder to the

3The distribution of Uniform, QPM-D, UCB, UCB-Strict,and UCB-Discard does not change if new data is not observed,so their performance should be the same as in the batch updat-ing setting. Therefore, we did not re-run those algorithms.

2

Page 3: Appendix: The Queue Method: Handling Delay, Heuristics ...grail.cs.washington.edu/projects/bandit/banditappendix.pdfAppendix for The Queue Method: Handling Delay, Heuristics, Prior

0 500 1000 1500 2000Batches (of size 100)

0

5

10

15

Cum

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)SDB-thom-1.0SDB-thom-0.1QPM-D-thom

Figure 2: Results (using our queue-based estimator) oneducational game data. SDB sees major improvementsby leveraging the heuristic.

arm(s) recommended by BASE. Hence instead of justpulling one arm per batch, in an online updating set-ting SDB can spread mass between multiple arms, evengiven deterministic black-box algorithms.

Sample-Efficient Unbiased Offline BanditEvaluation

Theorem 3. Queue Replay Evaluation estimates areunbiased conditioned on the fact that the algorithm pro-duces a sequence of actions for which we issue esti-mates. Specifically,

E [rt|s ∈ Ut] =∑

s′={i,...,j}∈Ut

p(s′|s′ ∈ Ut, θ)µj

.

Proof. The proof builds on Lemma 4 in (Joulani, Gy-orgy, and Szepesvari 2013). We can prove this by in-duction: At the initial step, the probability of the se-quence and the expected value of the estimate at time 0are trivially the same as in the real environment. Now,at time t, we know that the probability of seeing anypast sequence of samples s′′ is p(s′′|s′′ ∈ Ut−1, θ),and we also know all t − 1 past estimates were issuedwith the correct prediction. So take any one of those se-quences s′′ (of length t− 1). Now, the distribution overstates of the algorithm given the past sequence of pullsis identical to the true system, since the state of the al-gorithm is defined by the past sequence of pulls and therewards, and rewards were drawn iid from each arm.Therefore, p(j pulled|s′′) = p(j pulled|s′′), where pdenotes the probability when running the queue-basedevaluator. Therefore the probability of extending anys′′ ∈ Ut−1 to any t-length sequence s′ is the same asin the real environment, that is p(s′|s′′ ∈ Ut−1) =p(s′|s′′ ∈ Ut−1). Therefore the marginal distributionp(s′|s′′ ∈ Ut−1, s

′ ∈ Ut) = p(s′|s′′ ∈ Ut−1, s′ ∈ Ut).

Now, given s′ ∈ Ut, s′′ ∈ Ut−1 since we must havenot hit the end of the queue on step t − 1 as well, sop(s′|s′ ∈ Ut) = p(s′|s′ ∈ Ut). Finally, if we pull armj, the result is iid, so the expectation of rt is µj .

ReferencesJoulani, P.; Gyorgy, A.; and Szepesvari, C. 2013. On-line learning under delayed feedback. In Proceedings ofThe 30th International Conference on Machine Learn-ing, 1453–1461.

3

Page 4: Appendix: The Queue Method: Handling Delay, Heuristics ...grail.cs.washington.edu/projects/bandit/banditappendix.pdfAppendix for The Queue Method: Handling Delay, Heuristics, Prior

0 1000 2000 3000 4000 5000Batches (of size 100)

0

2

4

6

8

10

12

14

Cum

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)

SDB-thom-1.0SDB-thom-0.01QPM-D-thom

(a) Comparing to QPM-D with Thomp-son Sampling as the black-box algo-rithm.

0 1000 2000 3000 4000 5000Batches (of size 100)

0

5

10

15

20

Cum

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)

Thompson-Batch-1.0Thompson-Batch-0.01SDB-thom-1.0SDB-thom-0.01

(b) Comparing to heuristics withThompson Sampling as the black-boxalgorithm.

0 1000 2000 3000 4000 5000Batches (of size 10)

0

5

10

15

20

Cum

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)

Thompson-Batch-1.0Thompson-Batch-0.01SDB-thom-0.01

(c) An example where the heuris-tic Thompson-Batch-0.01 performsworse.

0 1000 2000 3000 4000 5000Batches (of size 100)

0

2

4

6

8

10

Cum

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)

SDB-ucb-1.0SDB-ucb-0.01QPM-D-ucb

(d) Comparing to QPM-D using UCBas the black-box algorithm.

0 1000 2000 3000 4000 5000Batches (of size 100)

0

2

4

6

8

10

Cum

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)

UCB-discard-1.0SDB-ucb-discard-1.0UCB-strict-1.0SDB-ucb-strict-1.0

(e) Two example algorithms that per-form poorly when handed all samplesbut well inside SDB.

0 1000 2000 3000 4000 5000Batches (of size 1000)

−40

−20

0

20

40

60C

um

ula

tive R

ew

ard

(D

iffe

rence

fro

m U

niform

)Thompson-Batch-1.0Thompson-Batch-0.01SDB-thom-1.0SDB-thom-0.01

(f) An example of a case where handinga prior dataset from a poor arm hurtsThompson-Batch but not SDB.

Figure 1: Simulation Results. SDB-thom-X refers to running SDB with Thompson-1.0 as the BASE algorithm andThompson-X as the HEURISTIC algorithm, and likewise for UCB.

4