littlestone's dimension and online learnability

34
Littlestone’s Dimension and Online Learnability Shai Shalev-Shwartz Toyota Technological Institute at Chicago The Hebrew University Talk at UCSD workshop, February, 2009 Joint work with Shai Ben-David and David Pal Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 1 / 21

Upload: others

Post on 03-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Littlestone's Dimension and Online Learnability

Littlestone’s Dimension and Online Learnability

Shai Shalev-Shwartz

Toyota Technological Institute at Chicago ⇒ The Hebrew University

Talk at UCSD workshop, February, 2009

Joint work with Shai Ben-David and David Pal

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 1 / 21

Page 2: Littlestone's Dimension and Online Learnability

Online Learning

For t = 1, . . . , TEnvironment presents input xt ∈ XLearner predicts label yt ∈ {0, 1}Environment reveals true label yt ∈ {0, 1}Learner pays 1 if yt 6= yt and 0 otherwise

Goal: Make few mistakes

Online Learnability: When can we guarantee to make few mistakes ?

PAC Learnability: well understood (VC theory)

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 2 / 21

Page 3: Littlestone's Dimension and Online Learnability

Online Learning

For t = 1, . . . , TEnvironment presents input xt ∈ XLearner predicts label yt ∈ {0, 1}Environment reveals true label yt ∈ {0, 1}Learner pays 1 if yt 6= yt and 0 otherwise

Goal: Make few mistakes

Online Learnability: When can we guarantee to make few mistakes ?

PAC Learnability: well understood (VC theory)

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 2 / 21

Page 4: Littlestone's Dimension and Online Learnability

Online Learning

For t = 1, . . . , TEnvironment presents input xt ∈ XLearner predicts label yt ∈ {0, 1}Environment reveals true label yt ∈ {0, 1}Learner pays 1 if yt 6= yt and 0 otherwise

Goal: Make few mistakes

Online Learnability: When can we guarantee to make few mistakes ?

PAC Learnability: well understood (VC theory)

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 2 / 21

Page 5: Littlestone's Dimension and Online Learnability

Outline

Online Learnability:Can we be almost as good as the best predictor in a reference class H ?

Finite H Infinite H margin-based H

No noise

Halving L’88 X

Arbitrary noise

LW’94 X X

Stochastic noise

X X X

Upper and (almost) matching lower bounds

Seamlessly deriving new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 3 / 21

Page 6: Littlestone's Dimension and Online Learnability

Outline

Online Learnability:Can we be almost as good as the best predictor in a reference class H ?

Finite H Infinite H margin-based H

No noise Halving

L’88 X

Arbitrary noise

LW’94 X X

Stochastic noise

X X X

Upper and (almost) matching lower bounds

Seamlessly deriving new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 3 / 21

Page 7: Littlestone's Dimension and Online Learnability

Outline

Online Learnability:Can we be almost as good as the best predictor in a reference class H ?

Finite H Infinite H margin-based H

No noise Halving L’88

X

Arbitrary noise

LW’94 X X

Stochastic noise

X X X

Upper and (almost) matching lower bounds

Seamlessly deriving new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 3 / 21

Page 8: Littlestone's Dimension and Online Learnability

Outline

Online Learnability:Can we be almost as good as the best predictor in a reference class H ?

Finite H Infinite H margin-based H

No noise Halving L’88

X

Arbitrary noise LW’94

X X

Stochastic noise

X X X

Upper and (almost) matching lower bounds

Seamlessly deriving new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 3 / 21

Page 9: Littlestone's Dimension and Online Learnability

Outline

Online Learnability:Can we be almost as good as the best predictor in a reference class H ?

Finite H Infinite H margin-based H

No noise Halving L’88 X

Arbitrary noise LW’94 X X

Stochastic noise X X X

Upper and (almost) matching lower bounds

Seamlessly deriving new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 3 / 21

Page 10: Littlestone's Dimension and Online Learnability

Outline

Online Learnability:Can we be almost as good as the best predictor in a reference class H ?

Finite H Infinite H margin-based H

No noise Halving L’88 X

Arbitrary noise LW’94 X X

Stochastic noise X X X

Upper and (almost) matching lower bounds

Seamlessly deriving new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 3 / 21

Page 11: Littlestone's Dimension and Online Learnability

Realizable Case (no noise)

Realizable Assumption: Environment answers yt = h(xt), where h ∈ Hand the hypothesis class, H, is known to the learner

Theorem (Littlestone’88)

A combinatorial dimension, Ldim(H), characterizes online learnability:

Any algorithm might make at least Ldim(H) mistakes

Exists algorithm that makes at most Ldim(H) mistakes

But, only in the realizable case ...

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 4 / 21

Page 12: Littlestone's Dimension and Online Learnability

Littlestone’s dimension – Motivation

1 2 3 4 5 6 7 8

h1

h2

h8

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 5 / 21

Page 13: Littlestone's Dimension and Online Learnability

Littlestone’s dimension – Motivation

1 2 3 4 5 6 7 8

h1

h2

h8

4

2

h1

-

h2

+

-

6

h5

-

h6

+

+

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 6 / 21

Page 14: Littlestone's Dimension and Online Learnability

Littlestone’s dimension

Definition

Ldim(H) is the maximal depth of a full binary tree such that each path is“explained” by some h ∈ H

Lemma

Any learner can be forced to make at least Ldim(H) mistakes

Proof.

Adversarial environment will “walk” on the tree, while on each roundsetting yt = ¬yt.

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 7 / 21

Page 15: Littlestone's Dimension and Online Learnability

Standard Optimal Algorithm (SOA)

initialize: V1 = Hfor t = 1, 2, . . .

receive xtfor r ∈ {0, 1} let V (r)

t = {h ∈ Vt : h(xt) = r}predict yt = arg maxr Ldim(V (r)

t )receive true answer ytupdate Vt+1 = V

(yt)t

Theorem

SOA makes at most Ldim(H) mistakes.

Proof.

Whenever SOA errs we have Ldim(Vt+1) ≤ Ldim(Vt)− 1.

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 8 / 21

Page 16: Littlestone's Dimension and Online Learnability

Standard Optimal Algorithm (SOA)

initialize: V1 = Hfor t = 1, 2, . . .

receive xtfor r ∈ {0, 1} let V (r)

t = {h ∈ Vt : h(xt) = r}predict yt = arg maxr Ldim(V (r)

t )receive true answer ytupdate Vt+1 = V

(yt)t

Theorem

SOA makes at most Ldim(H) mistakes.

Proof.

Whenever SOA errs we have Ldim(Vt+1) ≤ Ldim(Vt)− 1.

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 8 / 21

Page 17: Littlestone's Dimension and Online Learnability

Intermediate Summary

Littlestone’s dimension characterizes online learnability

Example:H = { all 100 characters long C++ functions }⇒ Ldim(H) ≤ 500

Received relatively little attention by researchers

Maybe due to:

Non-realistic realizable assumptionLack of interesting examplesLack of margin-based theory

Coming Next – Generalizing to:

Agnostic case (noise is allowed)Fat dimension and margin-based boundsLinear separators⇒ new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 9 / 21

Page 18: Littlestone's Dimension and Online Learnability

Intermediate Summary

Littlestone’s dimension characterizes online learnability

Example:H = { all 100 characters long C++ functions }⇒ Ldim(H) ≤ 500Received relatively little attention by researchers

Maybe due to:

Non-realistic realizable assumptionLack of interesting examplesLack of margin-based theory

Coming Next – Generalizing to:

Agnostic case (noise is allowed)Fat dimension and margin-based boundsLinear separators⇒ new algorithms/bounds

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 9 / 21

Page 19: Littlestone's Dimension and Online Learnability

Agnostic Online Learning and Regret Analysis

Make no assumptions on origin of labels

Analyze regret of not following best predictor in H:

T∑t=1

|yt − yt| − minh∈H

T∑t=1

|h(xt)− yt|

When can we guarantee low regret ?

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 10 / 21

Page 20: Littlestone's Dimension and Online Learnability

Cover’s impossibility result

H = {h(x) = 1, h(x) = 0}Ldim(H) = 1Environment will output yt = ¬ytLearner makes T mistakes

Best in H makes at most T/2 mistakes

Regret is at least T/2

Corollary: Online learning in the non-realizable case is impossible ?!?

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 11 / 21

Page 21: Littlestone's Dimension and Online Learnability

Randomized Prediction and Expected Regret

Let’s weaken the environment – it should decide on yt before seeing yt

For deterministic learner, environment can simulate learner so there’sno difference

For learner that randomizes his predictions – big difference

We analyze expected regret

T∑t=1

E[|yt − yt|] − minh∈H

T∑t=1

|h(xt)− yt|

This enables to sidestep Cover’s impossibility result

Online learning in the non-realizable case becomes possible !

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 12 / 21

Page 22: Littlestone's Dimension and Online Learnability

Weighed Majority

WM for learning with d experts

initialize: assign weight wi = 1 for each expertfor t = 1, 2, . . . , T

each expert predicts fi ∈ {0, 1}environment determines yt without revealing it to the learnerpredict yt = 1 w.p. ∝

∑i:fi=1wi

receive label ytforeach wrong expert: wi ← η wi

Theorem

WM achieves expected regret of at most:√

ln(d)T

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 13 / 21

Page 23: Littlestone's Dimension and Online Learnability

Weighed Majority

WM for learning with d experts

initialize: assign weight wi = 1 for each expertfor t = 1, 2, . . . , T

each expert predicts fi ∈ {0, 1}environment determines yt without revealing it to the learnerpredict yt = 1 w.p. ∝

∑i:fi=1wi

receive label ytforeach wrong expert: wi ← η wi

Theorem

WM achieves expected regret of at most:√

ln(d)T

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 13 / 21

Page 24: Littlestone's Dimension and Online Learnability

WM and Online Learnability

WM regret bound ⇒ a finite H is learnable with regret√

ln(|H|)TIs this the best we can do ? And, what if H is infinite ?

Solution: Combing WM with SOA

Theorem

Exists learner with expected regret√

Ldim(H)T log(T )No learner can have expected regret smaller than

√Ldim(H)T

Therefore: H is agnostic online learnable ⇐⇒ Ldim(H) <∞

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 14 / 21

Page 25: Littlestone's Dimension and Online Learnability

WM and Online Learnability

WM regret bound ⇒ a finite H is learnable with regret√

ln(|H|)TIs this the best we can do ? And, what if H is infinite ?

Solution: Combing WM with SOA

Theorem

Exists learner with expected regret√

Ldim(H)T log(T )No learner can have expected regret smaller than

√Ldim(H)T

Therefore: H is agnostic online learnable ⇐⇒ Ldim(H) <∞

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 14 / 21

Page 26: Littlestone's Dimension and Online Learnability

Proof idea

Expert(i1, . . . , iL)

initialize: V1 = Hfor t = 1, 2, . . .

receive xtfor r ∈ {0, 1} let V (r)

t = {h ∈ Vt : h(xt) = r}define yt = arg maxr Ldim(V (r)

t )if t ∈ {i1, . . . , iL} flip prediction: yt ← ¬ytupdate Vt+1 = V

(yt)t

Lemma

If Ldim(H) <∞, then for any h ∈ H exists i1, . . . , iL, L < Ldim(H), s.t.Expert(i1, . . . , iL) agrees with h on the entire sequence.

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 15 / 21

Page 27: Littlestone's Dimension and Online Learnability

Agnostic Online Learning – Bounded Stochastic Noise

Previous theorem holds for any noise

For stochastic noise – better results

Assume: yt = h(xt) +2 νt, where P[νt = 1] ≤ γ < 12

Then, there exists learner with:

E

[T∑t=1

|yt − h(xt)|

]≤ 1

1−2√γ(1−γ)

Ldim(H) ln(T )

Learner is better than teacher: Learner makes O(ln(T )) mistakeswhile teacher makes γ T mistakes

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 16 / 21

Page 28: Littlestone's Dimension and Online Learnability

Fat Littlestone’s dimension

Consider hypotheses of the form h : X → R, where actual predictionis sign(h(x))Fat Littlestone’s dimension: Maximal depth of tree such that eachpath is explained by some h ∈ H with margin γ

Importance: Can apply analysis tools for bounding a combinatorialobject

Theorem

Let M be expected #mistakes of online learner

Let Mγ(H) be #margin-mistakes of optimal h ∈ H

M ≤ Mγ(H) +√

Ldimγ(H) ln(T )T

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 17 / 21

Page 29: Littlestone's Dimension and Online Learnability

Fat Littlestone’s dimension of linear separators

Linear predictors: H = {x 7→ 〈w,x〉 : ‖w‖ ≤ 1}

Lemma

If X is the unit ball of a σ-regular Banach space (B, ‖ · ‖?), thenLdimγ(H) ≤ σ

γ2

Examples:

X H Ldimγ(H)

{x : ‖x‖2 ≤ 1} {x 7→ 〈w,x〉 : ‖w‖2 ≤ 1} 1γ2

{x : ‖x‖∞ ≤ 1} {x 7→ 〈w,x〉 : ‖w‖1 ≤ 1} log(n)γ2

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 18 / 21

Page 30: Littlestone's Dimension and Online Learnability

Fat Littlestone’s dimension of linear separators

Linear predictors: H = {x 7→ 〈w,x〉 : ‖w‖ ≤ 1}

Lemma

If X is the unit ball of a σ-regular Banach space (B, ‖ · ‖?), thenLdimγ(H) ≤ σ

γ2

Examples:

X H Ldimγ(H)

{x : ‖x‖2 ≤ 1} {x 7→ 〈w,x〉 : ‖w‖2 ≤ 1} 1γ2

{x : ‖x‖∞ ≤ 1} {x 7→ 〈w,x〉 : ‖w‖1 ≤ 1} log(n)γ2

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 18 / 21

Page 31: Littlestone's Dimension and Online Learnability

Fat Littlestone’s dimension of linear separators

Linear predictors: H = {x 7→ 〈w,x〉 : ‖w‖ ≤ 1}

Lemma

If X is the unit ball of a σ-regular Banach space (B, ‖ · ‖?), thenLdimγ(H) ≤ σ

γ2

Examples:

X H Ldimγ(H)

{x : ‖x‖2 ≤ 1} {x 7→ 〈w,x〉 : ‖w‖2 ≤ 1} 1γ2

{x : ‖x‖∞ ≤ 1} {x 7→ 〈w,x〉 : ‖w‖1 ≤ 1} log(n)γ2

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 18 / 21

Page 32: Littlestone's Dimension and Online Learnability

(Surprising) Corollary: Regret with non-convex loss

M ≤ Mγ(H) + 1γ

√ln(T )T

Freund and Schapire’99 – Quadratic loss

Gentile 02 – hinge loss

No result with non-convex loss

a

`(a, y)

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 19 / 21

Page 33: Littlestone's Dimension and Online Learnability

Summary

Online Learning PAC Learning

Dimension Ldim(H) VCdim(H)

Realizable case: dimT X X

Agnostic case:√

dimT X X

Low noise: dimT X X

Margin: X X

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 20 / 21

Page 34: Littlestone's Dimension and Online Learnability

Some Open Problems

Ldim and fat-Ldim calculus

Bridging the log(T ) gap between lower and upper bounds

Other noise conditions (Tsybakov, Steinwart)

Multiclass prediction with bandit feedback: Efficient algorithms?Lower bounds ?

Low Ldim⇒ Compression scheme ⇒ Low VCdim

Low Ldim ?⇐ Compression scheme?⇐ Low VCdim

Shai Shalev-Shwartz (TTI-C) Online Learnability Feb’09 21 / 21