Upper confidence bound algorithms Christos Dimitrakakis EPFL - - PowerPoint PPT Presentation

upper confidence bound algorithms
SMART_READER_LITE
LIVE PREVIEW

Upper confidence bound algorithms Christos Dimitrakakis EPFL - - PowerPoint PPT Presentation

Upper confidence bound algorithms Christos Dimitrakakis EPFL November 6, 2013 Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 1 / 22 1 Introduction 2 Bandit problems UCB 3 Structured bandit problems 4


slide-1
SLIDE 1

Upper confidence bound algorithms

Christos Dimitrakakis

EPFL

November 6, 2013

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 1 / 22

slide-2
SLIDE 2

1 Introduction 2 Bandit problems

UCB

3 Structured bandit problems 4 Reinforcement learning problems

Optimality Criteria UCRL

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 2 / 22

slide-3
SLIDE 3

Bandit problems

The stochastic bandit problem

A set of K bandits, actions A = {1, . . . , K} Expected reward of the i-th bandit: µi E(rt | at = i). Maximise:

T

  • t=1

rt, (2.1) where T is arbitrary. What is a good heuristic strategy?

Definition (Regret)

The (total) regret of a policy π relative to the optimal policy is: LT(π)

T

  • t=1

r∗

t − rπ t

(2.2)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 3 / 22

slide-4
SLIDE 4

Bandit problems

Empirical average

ˆ µt,i 1 nt,i

t

  • k=1

rk,i I {ak = i} , nt,i

t

  • k=1

I {ak = i} . Algorithm 1 Optimistic initial values Input A, R rmax max R for t = 1, . . . do ut,i = nt−1,i ˆ

µt−1,i+rmax nt−1,i+1

at = arg maxi∈A ut,i end for

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 4 / 22

slide-5
SLIDE 5

Bandit problems

A simple analysis in the deterministic case

Consider the case where rt,i = µt,i for all bandits. Then ut,i ≥ µi for all t, i.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 5 / 22

slide-6
SLIDE 6

Bandit problems

A simple analysis in the deterministic case

Consider the case where rt,i = µt,i for all bandits. Then ut,i ≥ µi for all t, i. At time t, we play i if ut,i ≥ ut,j for all j.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 5 / 22

slide-7
SLIDE 7

Bandit problems

A simple analysis in the deterministic case

Consider the case where rt,i = µt,i for all bandits. Then ut,i ≥ µi for all t, i. At time t, we play i if ut,i ≥ ut,j for all j. But ut,j ≥ µj

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 5 / 22

slide-8
SLIDE 8

Bandit problems

A simple analysis in the deterministic case

Consider the case where rt,i = µt,i for all bandits. Then ut,i ≥ µi for all t, i. At time t, we play i if ut,i ≥ ut,j for all j. But ut,j ≥ µj If µ∗ maxj µj, we play i at most nt,i ≤ rmax ∆i times, where ∆i = µ∗ − µi.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 5 / 22

slide-9
SLIDE 9

Bandit problems

A simple analysis in the deterministic case

Consider the case where rt,i = µt,i for all bandits. Then ut,i ≥ µi for all t, i. At time t, we play i if ut,i ≥ ut,j for all j. But ut,j ≥ µj If µ∗ maxj µj, we play i at most nt,i ≤ rmax ∆i times, where ∆i = µ∗ − µi. Since every time we play i we lose ∆i, the regret is LT ≤

  • i=j

∆i rmax − µ∗ ∆i = (K − 1)(rmax − µ∗)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 5 / 22

slide-10
SLIDE 10

Bandit problems UCB

Algorithm 2 UCB1 Input A, R ˆ µ0,i = rmax, ∀i. for t = 1, . . . do ut,i = ˆ µt−1, i +

  • 2 ln t

nt−1,i .

at = arg maxi∈A ut,i end for

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 6 / 22

slide-11
SLIDE 11

Bandit problems UCB

Theorem (Auer et al [? ])

The expected regret of UCB1 after T rounds is at most c1

  • i:µi<µ∗

ln T ∆i

  • + c2

K

  • j=1

∆j

Proof.

First we prove that E nt,i ≤ O ln T ∆2

i

  • Then we note that the expected regret can be written as
  • i:µi<µ∗

∆i E nt,i due to Wald’s identity.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 7 / 22

slide-12
SLIDE 12

Bandit problems UCB

Let Bt,s =

  • (2 ln t)/s. Then we can prove ∀c ∈ Z:

nT,i = 1 +

T

  • t=K+1

I {at = i} ≤ c +

T

  • t=K+1

I {at = i ∧ nt−1,i ≥ c} ≤ c +

T

  • t=K+1

I

  • ˆ

µ∗

n∗

t−1 + Bt−1,n∗ t−1 ≤ max ˆ

µni(t−1),i + Bt−1,ni(t−1)

  • ≤ c +

T

  • t=K+1

I

  • min

0<s<t ˆ

µ∗

s + Bt−1,s ≤ max c≤si<t ˆ

µsi,i + Bt−1,si

  • ≤ c +

  • t=1

t−1

  • s=1

t−1

  • si=c

I {ˆ µ∗

s + Bt−1,s ≤ ˆ

µsi,i + Bt−1,si}

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 8 / 22

slide-13
SLIDE 13

Bandit problems UCB

Let Bt,s =

  • (2 ln t)/s. Then we can prove ∀c ∈ Z:

nT,i ≤ c +

  • t=1

t−1

  • s=1

t−1

  • si=c

I {ˆ µ∗

s + Bt−1,s ≤ ˆ

µsi,i + Bt−1,si} When the indicator function is true one of the following holds: ˆ µ∗

s ≤ µ∗ − Bt,s

(2.3) ˆ µsi,i ≥ µi + Bt,si (2.4) µ∗ < µi + 2Bt,si (2.5)

Proof idea

Bound the probability of the first two events. Choose c to bound the last term.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 8 / 22

slide-14
SLIDE 14

Bandit problems UCB

From Hoeffding bound: P(ˆ µ∗

s ≤ µ∗ − Bt,s) ≤ e−4 ln t = t−4

(2.6) P(ˆ µsi,i ≥ µi + Bt,si) ≤ e−4 ln t = t−4 (2.7) Setting c =

  • (8 ln n)/∆2

i

  • makes the last event false as si ≥ c.

µ∗ − µi − 2Bt,si = µ∗ − µi − 2

  • (2 ln t)/si ≥ µ∗ − µi − ∆i = 0.

Summing up all the terms completes the proof.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 9 / 22

slide-15
SLIDE 15

Structured bandit problems

Bandits and optimisation

Continuous stochastic functions[? ? ? ] Constrained deterministic distributed functions[? ]

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 10 / 22

slide-16
SLIDE 16

Structured bandit problems

First idea[? ]

Solve a sequence of discrete bandit problems.

At epoch i, we have some interval Ai Split the interval Ai in k regions Ai,j Run UCB on the k-armed bandit problem. When a region is sub-optimal with high probability, remove it!

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 11 / 22

slide-17
SLIDE 17

Structured bandit problems

Tree bandits [? ]

Create a tree of coverings, with (h, i) being the i-th node at depth h. D are the descendants and C the children of a node. At time t we pick node Ht, It. Each node is picked at most once. nh,i(T)

T

  • t=1

I {(Ht, It) ∈ D(h, i)} (visits of (h, i))

  • µh,i(T)

1 nh,i(T)

T

  • t=1

rt I {(Ht, It) ∈ C(h, i)} (reward from (h, i)) (child bound)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 12 / 22

slide-18
SLIDE 18

Structured bandit problems

Tree bandits [? ]

Create a tree of coverings, with (h, i) being the i-th node at depth h. D are the descendants and C the children of a node. At time t we pick node Ht, It. Each node is picked at most once. nh,i(T)

T

  • t=1

I {(Ht, It) ∈ D(h, i)} (visits of (h, i))

  • µh,i(T)

1 nh,i(T)

T

  • t=1

rt I {(Ht, It) ∈ C(h, i)} (reward from (h, i)) Ch,i(T) µh,i(T) +

  • 2 ln T

nh,i(T) + nu1ρh (confidence bound) Bh,i(T) min

  • Ch,i(T),

max

(h+1,j)∈C(h,i) Bh+1,j

  • (child bound)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 12 / 22

slide-19
SLIDE 19

Reinforcement learning problems Optimality Criteria

Infinite horizon, discounted

Discount factor γ such that Ut =

  • k=0

γkrt+k (4.1)

Geometric horizon, undiscounted

At each step t, the process terminates with probability 1 − γ: UT

t = T−t

  • k=0

rt+k, T ∼ Geom(1 − γ) (4.2) V π

γ (s) E(Ut | st = s)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 13 / 22

slide-20
SLIDE 20

Reinforcement learning problems Optimality Criteria

Infinite horizon, discounted

Discount factor γ such that Ut =

  • k=0

γkrt+k ⇒ E Ut =

  • k=0

γk E rt+k (4.1)

Geometric horizon, undiscounted

At each step t, the process terminates with probability 1 − γ: UT

t = T−t

  • k=0

rt+k, T ∼ Geom(1 − γ) ⇒ E Ut =

  • k=0

γk E rt+k (4.2) V π

γ (s) E(Ut | st = s)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 13 / 22

slide-21
SLIDE 21

Reinforcement learning problems Optimality Criteria

The expected total reward criterion

V π,T

t

Eπ UT

t ,

V π lim

T→∞ V π,T

(4.3)

Dealing with the limit

Consider µ s.t. the limit exists ∀π.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 14 / 22

slide-22
SLIDE 22

Reinforcement learning problems Optimality Criteria

The expected total reward criterion

V π,T

t

Eπ UT

t ,

V π lim

T→∞ V π,T

(4.3)

Dealing with the limit

Consider µ s.t. the limit exists ∀π. V π

+(s) Eπ

  • t=1

r+

t

  • st = s
  • ,

V π

−(s) Eπ

  • t=1

r−

t

  • st = s
  • (4.4)

r+

t max{−r, 0},

r−

t max{r, 0}.

(4.5)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 14 / 22

slide-23
SLIDE 23

Reinforcement learning problems Optimality Criteria

The expected total reward criterion

V π,T

t

Eπ UT

t ,

V π lim

T→∞ V π,T

(4.3)

Dealing with the limit

Consider µ s.t. the limit exists ∀π. Consider µ s.t. ∃π∗ for which V π∗ exists and lim

T→∞ V π∗,T = V π∗ ≥ lim sup T→∞

V π,T.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 14 / 22

slide-24
SLIDE 24

Reinforcement learning problems Optimality Criteria

The expected total reward criterion

V π,T

t

Eπ UT

t ,

V π lim

T→∞ V π,T

(4.3)

Dealing with the limit

Consider µ s.t. the limit exists ∀π. Consider µ s.t. ∃π∗ for which V π∗ exists and lim

T→∞ V π∗,T = V π∗ ≥ lim sup T→∞

V π,T. Use optimality criteria sensitive to the divergence rate.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 14 / 22

slide-25
SLIDE 25

Reinforcement learning problems Optimality Criteria

The average reward (gain) criterion

The gain g

gπ(s) lim

T→∞

1 T V π,T(s) (4.4) gπ

+(s) lim sup T→∞

1 T V π,T(s), gπ

−(s) lim inf T→∞

1 T V π,T(s) (4.5) If limT→∞ E(rT | s0 = s) exists then it equals gπ(s).

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 15 / 22

slide-26
SLIDE 26

Reinforcement learning problems Optimality Criteria

Let Π be the set of all history-dependent, randomised policies. π∗ is total reward optimal if V π∗(s) ≥ V π(s) ∀s ∈ S, π ∈ Π. π∗ is discount optimal for γ ∈ [0, 1) if V π∗

γ (s) ≥ V π γ (s)

∀s ∈ S, π ∈ Π. π∗ is gain optimal if gπ∗(s) ≥ gπ(s) ∀s ∈ S, π ∈ Π.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 16 / 22

slide-27
SLIDE 27

Reinforcement learning problems Optimality Criteria

Overtaking optimality

π∗ is overtaking optimal if lim inf

T→∞

  • V π∗,T(s) − V π,T(s)
  • ≥ 0

∀s ∈ S, π ∈ Π. However, no overtaking optimal policy may exist. π∗ is average-overtaking optimal if lim inf

T→∞

1 T

  • V π∗,T(s) − V π

+(s)

  • ≥ 0

∀s ∈ S, π ∈ Π.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 17 / 22

slide-28
SLIDE 28

Reinforcement learning problems Optimality Criteria

Sensitive discount optimality

π∗ is n-discount optimal for n ∈ {−1, 0, 1, . . .} if lim inf

γ↑1 (1 − γ)−n

V π∗

γ (s) − V π γ (s)

  • ≥ 0

∀s ∈ S, π ∈ Π. A policy is Blackwell optimal if ∀s, ∃γ∗(s) such that V π∗

γ (s) − V π γ (s) ≥ 0,

∀π ∈ Π, γ∗(s)γγ < 1.

Lemma

If a policy is m-discount optimal then it is n-discount optimal for all n ≤ m.

Lemma

Gain optimality is equivalent to −1-discount optimality.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 18 / 22

slide-29
SLIDE 29

Reinforcement learning problems UCRL

An upper-confidence bound algorithm

Confidence region Mt such that P(µ / ∈ Mt) < δ (4.6) Optimistic value for policy π: V π

+(Mt) max

  • V π

µ

  • µ ∈ Mt
  • (4.7)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 19 / 22

slide-30
SLIDE 30

Reinforcement learning problems UCRL

An upper-confidence bound algorithm

Confidence region Mt such that P(µ / ∈ Mt) < δ (4.6) Optimistic value for policy π: V π

+(Mt) max

  • V π

µ

  • µ ∈ Mt
  • (4.7)

UCRL [? ] outline

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 19 / 22

slide-31
SLIDE 31

Reinforcement learning problems UCRL

An upper-confidence bound algorithm

Confidence region Mt such that P(µ / ∈ Mt) < δ (4.6) Optimistic value for policy π: V π

+(Mt) max

  • V π

µ

  • µ ∈ Mt
  • (4.7)

UCRL [? ] outline

At round k, start time tk, calculate Mtk.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 19 / 22

slide-32
SLIDE 32

Reinforcement learning problems UCRL

An upper-confidence bound algorithm

Confidence region Mt such that P(µ / ∈ Mt) < δ (4.6) Optimistic value for policy π: V π

+(Mt) max

  • V π

µ

  • µ ∈ Mt
  • (4.7)

UCRL [? ] outline

At round k, start time tk, calculate Mtk. Choose πk ∈ arg maxπ V π

+(Mtk).

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 19 / 22

slide-33
SLIDE 33

Reinforcement learning problems UCRL

An upper-confidence bound algorithm

Confidence region Mt such that P(µ / ∈ Mt) < δ (4.6) Optimistic value for policy π: V π

+(Mt) max

  • V π

µ

  • µ ∈ Mt
  • (4.7)

UCRL [? ] outline

At round k, start time tk, calculate Mtk. Choose πk ∈ arg maxπ V π

+(Mtk).

Execute πk, observe rewards and update model until tk+1.

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 19 / 22

slide-34
SLIDE 34

Reinforcement learning problems UCRL

The confidence region

Let Mt be a set of plausible MDPs for time t with transitions τ s.t.:

  • P (· | s, a) − ˆ

Pt(· | s, a)

  • 1 ≤
  • n ln T

Nt(s, a), ∀s ∈ S, a ∈ A, (4.8) where ˆ Pt(· | s, a) is the empirical transition probability. Then P(µ ∈ Mt) > 1 − nkT −2, via a bound due to Weissman [? ].

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 20 / 22

slide-35
SLIDE 35

Reinforcement learning problems UCRL

The confidence region

Let Mt be a set of plausible MDPs for time t with transitions τ s.t.:

  • P (· | s, a) − ˆ

Pt(· | s, a)

  • 1 ≤
  • n ln T

Nt(s, a), ∀s ∈ S, a ∈ A, (4.8) where ˆ Pt(· | s, a) is the empirical transition probability. Then P(µ ∈ Mt) > 1 − nkT −2, via a bound due to Weissman [? ].

Changing set of plausible MDPs

This implies that we may have to switch policies. We do so when Nt(s, a) doubles for some s, a .

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 20 / 22

slide-36
SLIDE 36

Reinforcement learning problems UCRL

Calculating the upper bound

In effect, create an augmented MDP Qt(s, a) = r(s, a) + max

  • s′∈S

P (s′ | s, a)Vt+1(s′)

  • P − ˆ

P 1 ≤ ǫ

  • (4.9)

Vt(s) = max

a∈A Qt(s, a)

(4.10)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 21 / 22

slide-37
SLIDE 37

Reinforcement learning problems UCRL

Comparison with Bayesian upper bound

High-probability value function bound

V ∗

+ = max

  • V ∗

µ

  • µ ∈ Mt
  • ,

P(µ∗ ∈ Mt) ≥ 1 − δ.

Highly credible value function bound

V ∗

+ = max

  • V ∗

µ

  • µ ∈ Mt
  • ,

ξt(Mt) ≥ 1 − δ.

Bayesian value function bound (e.g. [? ])

V ∗

+ =

  • M

V ∗

µ dξt(µ)

ξt = ξ0(· | st, rt, . . .)

Christos Dimitrakakis (EPFL) Upper confidence bound algorithms November 6, 2013 22 / 22