computational and statistical learning theorynati/teaching/ttic31120/2015/lecture4.pdfย ยท โขe.g....
TRANSCRIPT
Computational and StatisticalLearning Theory
TTIC 31120
Prof. Nati Srebro
Lecture 4:MDL and PAC-Bayes
Uniform vs Non-Uniform Bias
โข No Free Lunch: we need some โinductive biasโ
โข Limiting attention to hypothesis class โ: โflatโ bias
โข ๐ โ =1
โfor โ โ โ, and ๐ โ = 0 otherwise
โข Non-uniform bias: ๐ โ encodes bias
โข Can use any ๐ โ โฅ 0, s.t. โ ๐(โ) โค 1
โข E.g. choose prefix-disambiguous encoding ๐(โ) and use ๐ โ = 2โ ๐ โ
โข Or, choose ๐:๐ฐ โ ๐ด๐ณ over prefix-disambiguous programs ๐ฐ โ 0,1 โ
and use ๐ โ = 2โ min
๐ ๐ =โ๐
โข Choice of ๐ โ , ๐ โ or ๐ โ encodes are expert knowledge/inductive bias
Minimum Description Length Learning
โข Choose โpriorโ ๐(โ) s.t. โ ๐ โ โค 1 (or description language ๐ โ or ๐ โ )
โข Minimum Description Length learning rule(based on above prior/description language):
๐๐ท๐ฟ๐ ๐ = arg max๐ฟ๐ โ =0
๐(โ) = arg min๐ฟ๐ โ =0
|๐ โ |
โข For any ๐, w.p. โฅ 1 โ ๐ฟ,
๐ฟ ๐๐ท๐ฟ๐ ๐ โค infโ ๐ .๐ก.๐ฟ๐ โ =0
โ log ๐ โ + log 2/๐ฟ
2๐
Sample complexity: ๐ = ๐โ log ๐(โ)
๐2= ๐
๐ โ
๐2
(more careful analysis: ๐๐ โโ
๐)
MDL and Universal Learningโข Theorem: For any โ and ๐:โ โ [0,1], s.t. โ ๐(โ) โค 1, and any
source distribution ๐, if there exists โ with ๐ฟ โ = 0 and ๐ โ > 0, then w.p. โฅ 1 โ ๐ฟ over ๐ โผ ๐๐:
๐ฟ ๐๐ท๐ฟ๐ ๐ โคโ log ๐ โ + log 2/๐ฟ
2๐
โข Can learn any countable class!
โข Class of all computable functions, with ๐ โ = 2โ min
๐ ๐ =โ๐
.
โข Class enumerable with ๐:โ โ โ with ๐ โ = 2โ๐ โ
โข But VCdim(all computable functions)=โ !
โข Why no contradiction to Fundamental Theorem?
โข PAC Learning: Sample complexity ๐ ๐, ๐ฟ is uniform for all โ โ โ.Depends only on class โ, not on specific โโ
โข MDL: Sample complexity ๐(๐, ๐ฟ, ๐) depends on โ.
Uniform and Non-Uniform Learnability
โข Definition: A hypothesis class โ is agnostically PAC-Learnable if there
exists a learning rule ๐ด such that โ๐, ๐ฟ > 0, โ๐ ๐, ๐ฟ , โ๐, โ๐, โ๐โผ๐๐ ๐,๐ฟ๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
โข Definition: A hypothesis class โ is non-uniformly learnable if there exists
a learning rule ๐ด such that โ๐, ๐ฟ > 0, โโ, โ๐ ๐, ๐ฟ, ๐ , โ๐, โ๐โผ๐๐ ๐,๐ฟ,๐๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
โข Theorem: โ๐, if there exists โ with ๐ฟ โ = 0, then โ๐โผ๐๐๐ฟ
๐ฟ ๐๐ท๐ฟ๐ ๐ โคโ log ๐ โ + log 2/๐ฟ
2๐
Compete also with โ s.t. ๐ฟ โ > 0?
Allowing Errors: From MDL to SRM
๐ฟ โ โค ๐ฟ๐ โ +โ log ๐ โ + log 2/๐ฟ
2๐
โข Structural Risk Minimization:
๐๐ ๐๐ ๐ = argminโ
๐ฟ๐ โ +โ log ๐ โ
2๐
โข Theorem: For any prior ๐(โ), โ ๐(โ) โค 1, and any source distribution ๐, w.p. โฅ 1 โ ๐ฟ over ๐ โผ ๐๐:
๐ฟ ๐๐ ๐๐ ๐ โค infโ
๐ฟ โ + 2โ log ๐ โ + log 2/๐ฟ
๐
Minimized by MDLMinimized
by ERM
fit thedata match the prior /
simple / short description
Non-Uniform Learning: Beyond Cardinalityโข MDL still essentially based on cardinality (โhow many hypothesis are simpler
then meโ) and ignores relationship between predictors.
โข Generalizes the cardinality bound: Using ๐ โ =1
โwe get
๐ ๐, ๐ฟ, โ = ๐ ๐, ๐ฟ =log โ + log 2/๐ฟ
๐2
โข Can we treat continuous classes (e.g. linear predictors)?Move from cardinality to โgrowth functionโ?
โข E.g.:
โข โ = ๐ ๐๐๐ ๐ ๐ ๐ฅ | ๐:โ๐ โ โ is a polynomial , ๐:๐ณ โ โ๐
โข VCdim(โ)=โโข โ is uncountable, and there is no distribution with โโโโ๐ โ > 0โข But what if we bias toward lower order polynomials?
โข Answer 1: prior over hypothesis classesโข Write โ =โชโ๐ (e.g. โ๐ =degree-๐ polynomials)โข Use prior ๐(๐ป๐) over hypothesis classes
Prior Over Hypothesis Classes
โข VC bound: โ๐โ โโโโ๐๐ฟ โ โค ๐ฟ๐ โ + ๐
VCdim โ๐ +log 1 ๐ฟ๐
๐โฅ 1 โ ๐ฟ๐
โข Setting ๐ฟ๐ = ๐ โ๐ โ ๐ฟ and taking a union bound,
โ๐โผ๐๐๐ฟ โโ๐
โโโโ๐๐ฟ โ โค ๐ฟ๐ โ + ๐
VCdim โ๐ โ log ๐ โ๐ + log 1 ๐ฟ๐
โข Structural Risk Minimization over hypothesis classes:
๐๐ ๐๐ ๐ = arg minโโโ๐
๐ฟ๐ โ + ๐ถโ log ๐ โ๐ + VCdim โ๐
๐
โข Theorem: w.p. โฅ 1 โ ๐ฟ,
๐ฟ๐ ๐๐ ๐๐ ๐ โค minโ๐,โโโ๐
๐ฟ๐ โ + ๐โ log ๐ โ๐ + VCdim โ๐ + log
1๐ฟ
๐
Structural Risk Minimizationโข Theorem: For a prior ๐ โ๐ with โ๐
๐ โ๐ โค 1 and any ๐, โ๐โผ๐๐๐ฟ ,
๐ฟ๐ ๐๐ ๐๐ ๐ โค minโ๐,โโโ๐
๐ฟ๐ โ + ๐โ log ๐ โ๐ + VCdim โ๐ + log
1๐ฟ
๐
โข For โ๐ = โ๐ :
โข ๐๐ถ๐๐๐ โ๐ = 0
โข Reduces to โstandardโ SRM with a prior over hypothesis
โข For ๐ โ๐ = 1
โข Reduces to ERM over a finite-VC class
โข More general. Eg for polynomials over ๐ ๐ฅ โ โ๐ with ๐ degree ๐ = 2โ๐,
๐ ๐, ๐ฟ, โ = ๐degree(โ) + ๐ + 1 degree โ + log
1๐ฟ
๐2
โข Allows non-uniform learning of a countable union of finite-VC classes
Uniform and Non-Uniform Learnability
โข Definition: A hypothesis class โ is agnostically PAC-Learnable if there exists a
learning rule ๐ด such that โ๐, ๐ฟ > 0, โ๐ ๐, ๐ฟ , โ๐, โ๐, โ๐โผ๐๐ ๐,๐ฟ๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
โข Definition: A hypothesis class โ is non-uniformly learnable if there exists a
learning rule ๐ด such that โ๐, ๐ฟ > 0, โโ, โ๐ ๐, ๐ฟ, ๐ , โ๐, โ๐โผ๐๐ ๐,๐ฟ,๐๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
โข Theorem: A hypothesis class โ is non-uniformly learnable if and only ifit is a countable union of finite VC class (โ =โช๐โโ โ๐, VCdim โ๐ < โ)
โข Definition: A hypothesis class โ is โconsistently learnableโ if there exists a
learning rule ๐ด such that โ๐, ๐ฟ > 0, โโ โ๐, โ๐ ๐, ๐ฟ, โ, ๐ , โ๐โผ๐๐ ๐,๐ฟ,โ,๐๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
Consistency
โข ๐ณ countable (e.g. ๐ณ = 0,1 โ), โ = ยฑ1 ๐ณ (all possible functions)
โข โ is uncountable, it is not a countable union of finite VC classes, and is thus not non-uniformly learnable
โข Claim: โ is โconsistently learnableโ using๐ธ๐ ๐โ ๐ ๐ฅ = ๐๐ด๐ฝ๐๐ ๐ผ๐๐ ๐ฆ๐ ๐ . ๐ก. ๐ฅ๐ , ๐ฆ๐ โ ๐
โข Proof sketch: for any ๐,
โข Sort ๐ณ by decreasing probability. The tail has diminishing probability and thus for any ๐, there exists some prefix ๐ณโฒ of the sort s.t. the tail ๐ณ โ๐ณโฒ has probability mass โค ๐/2.
โข Weโll give up on the tail. ๐ณโฒ is finite, and so ยฑ1 โ is also finite.
โข Why only โconsistently learnableโ?
โข Size of ๐ณโ required to capture 1 โ ๐/2 of mass depends on ๐.
Uniform and Non-Uniform Learnability
โข Definition: A hypothesis class โ is agnostically PAC-Learnable if there exists a
learning rule ๐ด such that โ๐, ๐ฟ > 0, โ๐ ๐, ๐ฟ , โ๐, โ๐, โ๐โผ๐๐ ๐,๐ฟ๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
โข (Agnostically) PAC-Learnable iff VCdim โ < โ
โข Definition: A hypothesis class โ is non-uniformly learnable if there exists a
learning rule ๐ด such that โ๐, ๐ฟ > 0, โโ, โ๐ ๐, ๐ฟ, ๐ , โ๐, โ๐โผ๐๐ ๐,๐ฟ,๐๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
โข Non-uniformly learnable iff โ is a countable union of finite VC classes
โข Definition: A hypothesis class โ is โconsistently learnableโ if there exists a
learning rule ๐ด such that โ๐, ๐ฟ > 0, โโ โ๐, โ๐ ๐, ๐ฟ, โ, ๐ , โ๐โผ๐๐ ๐,๐ฟ,โ,๐๐ฟ ,
๐ฟ๐ ๐ด ๐ โค ๐ฟ๐ โ + ๐
SRM In Practice
๐๐ ๐๐ ๐ = arg minโโโ๐
๐ฟ๐ โ + ๐ถโ log๐ โ๐ + VCdim โ๐
๐
โข Bound is loose anyway. Better to view as bi-criteria optimization:argmin ๐ฟ๐ โ and โ log ๐ โ๐ + VCdim โ๐
E.g. serialize asargmin ๐ฟ๐ โ + ๐ โ log ๐ โ๐ + VCdim โ๐
โข Typically โlog ๐ โ๐ , VCdim โ๐ monotone in โcomplexityโ ๐argmin ๐ฟ๐ โ ๐๐ง๐ ๐(โ)
where๐ โ = min ๐ ๐ . ๐ก. โ โ โ๐
SRM as a Bi-Criteria Problemargmin ๐ฟ๐ โ and ๐(โ)
Regularization Path = argminโ ๐ฟ๐ โ + ๐ โ ๐ โ | 0 โค ๐ โค โ
Select ๐ using a validation setโexact bound not needed
๐(โ)
๐ฟ๐(โ)
โ
Regularization Path(Pareto Frontier)
๐ = โ
๐ = 0
Non-Uniform Learning: Beyond Cardinalityโข MDL still essentially based on cardinality (โhow many hypothesis are
simpler then meโ) and ignores relationship between predictors.
โข Can we treat continuous classes (e.g. linear predictors)?Move from cardinality? Take into account that many predictors are similar?
โข Answer 1: prior ๐(๐) over hypothesis class
โข Answer 2: PAC-Bayes Theory
โข Prior distribution ๐ (not necessarily discrete) over โ
David McAllester
PAC-Bayes
โข Until now (MDL, SRM) we used a discrete โpriorโ (discrete โdistributionโ ๐ โover hypothesis, or discrete โdistributionโ ๐(โ๐) over hypothesis classes)
โข Instead: encode inductive bias as distribution ๐ over hypothesis
โข Use randomized (averaged) predictor โ๐, where for each prediction choosesโ โผ ๐ and predicts โ(๐ฅ)
โข โ๐ ๐ฅ = ๐ฆ w. p. โโโผ๐ โ ๐ฅ = ๐ฆ
โข ๐ฟ๐ โ๐ = ๐ผโโผ๐ ๐ฟ๐ โ
โข Theorem: for any distribution ๐ over hypothesis and any ๐, โ๐โผ๐๐๐ฟ
๐ฟ๐ โ๐ โ ๐ฟ๐ โ๐ โค๐พ๐ฟ ๐||๐ + log 2๐
๐ฟ2 ๐ โ 1
KL-Divergence
๐พ๐ฟ(๐| ๐ = ๐ผโโผ๐ log๐๐
๐๐
= โ ๐ โ log๐ โ
๐ โfor discrete dist with pmf ๐, ๐
= โซ ๐๐ โ log๐๐ โ
๐๐ โ๐โ for continuous distributions
โข Measures how much ๐ deviates from ๐
โข ๐พ๐ฟ(๐| ๐ โฅ 0, and๐พ๐ฟ(๐| ๐ = 0 if and only if ๐ = ๐
โข If ๐ ๐ด > 0 while ๐ ๐ด = 0, ๐พ๐ฟ(๐| ๐ = โ (other direction is allowed)
โข ๐พ๐ฟ(๐ป1| ๐ป0 =information per sample for rejecting ๐ป0 when ๐ป1 is true
โข ๐พ๐ฟ ๐ฌ||Unif ๐ = log๐ โ ๐ป(๐ฌ)
โข ๐ผ ๐, ๐ = ๐พ๐ฟ ๐ ๐, ๐ ||๐ ๐ ๐ ๐
Solomon
Kullback
Richard
Leibler
PAC-Bayesโข For any distribution ๐ซ over hypothesis and any ๐, โ๐โผ๐๐
๐ฟ
๐ฟ๐ โ๐ฌ โ ๐ฟ๐ โ๐ฌ โค๐พ๐ฟ ๐||๐ + log 2๐
๐ฟ2 ๐ โ 1
โข Can only use hypothesis in the support of ๐ (otherwise ๐พ๐ฟ(๐| ๐ = โ)
โข For a finite โ with ๐ = Unif(โ)
โข Consider ๐ = point mass on h
โข ๐พ๐ฟ(๐| ๐ = log โ
โข Generalizes cardinality bound (up to log๐)
โข More generally, for a discrete ๐ and ๐ = point mass on h
โข ๐พ๐ฟ(๐| ๐ = ๐ โ log๐ โ
๐ โ=
1
๐ โ
โข Generalizes MDL/SRM (up to log๐)
โข For continuous ๐ (eg over linear predictors or polynomials)
โข For ๐=point-mass (or any discrete), ๐พ๐ฟ(๐| ๐ = โ
โข Take โ๐ as average over similar hypothesis (eg with same behavior on ๐)
PAC-Bayes
๐ฟ๐ โ๐ โค ๐ฟ๐ โ๐ +๐พ๐ฟ ๐||๐ + log 2๐
๐ฟ2 ๐ โ 1
โข What learning rule does the PAC-Bayes bound suggest?
๐๐ = argmin๐
๐ฟ๐ โ๐ + ๐ โ ๐พ๐ฟ ๐||๐
โข Theorem:๐๐ โ โ ๐ โ ๐โ๐ฝ๐ฟ๐ โ
for some โinverse temperatureโ ๐ฝ
โข As ๐ โ โ we ignore the data, corresponding to infinite temperature, ๐ฝ โ 0
โข As ๐ โ 0 we insist on minimizing ๐ฟ๐ โ๐ , corresponding to zero temperature, ๐ฝ โ โ, and the prediction becomes ERM (or rather, a distribution over the ERM hypothesis in the support of ๐)
PAC-Bayes vs Bayes
Bayesian approach:โข Assume โ โผ ๐ซ,
โข ๐ฆ1, โฆ , ๐ฆ๐ iid conditioned on โ, with ๐ฆ๐|๐ฅ๐ , โ = โ(๐ฅ๐), ๐ค. ๐. 1 โ ๐
โโ(๐ฅ๐), ๐ค. ๐. ๐
Use posterior:
๐ โ ๐ โ ๐ โ ๐ ๐ โ
= ๐ โ ๐ ๐ ๐ฅ๐ ๐(๐ฆ๐|๐ฅ๐)
โ ๐ โ ๐๐
1โ๐
โ ๐ฅ๐ โ ๐ฆ๐= ๐ โ
๐
1โ๐
๐ โ ๐ฅ๐ โ ๐ฆ๐
= ๐ โ ๐โ๐ฝ๐ฟ๐ โ
where ๐ฝ = ๐ log1โ๐
๐
PAC-Bayes vs BayesPAC-Bayes
โข ๐ encodes inductive bias, not assumption about reality
โข SRM-type bound minimized by Gibbs distribution
๐๐ โ โ ๐ โ ๐โ๐ฝ๐ฟ๐ โ
โข Post-hoc guarantee always valid (โ๐๐ฟ),
with no assumption about reality
๐ฟ๐ โ๐ โค ๐ฟ๐ โ๐ +๐พ๐ฟ ๐||๐ + log 2๐
๐ฟ2 ๐ โ 1
โข Bound valid for any ๐
โข If inductive bias very different from reality, bound will be high
Bayesian Approachโข ๐ซ is prior over reality
โข Posterior given by Gibbs distribution
๐๐ โ โ ๐ โ ๐โ๐ฝ๐ฟ๐ โ
โข Risk analysis assuming prior
PAC-Bayes: Tighter Version
โข For any distribution ๐ over hypothesis and any source distribution ๐, โ๐โผ๐๐๐ฟ
๐พ๐ฟ ๐ฟ๐ โ๐ ||๐ฟ๐ โ๐ โค๐พ๐ฟ ๐||๐ + log 2๐
๐ฟ๐ โ 1
where ๐พ๐ฟ(๐ผ| ๐ฝ = ๐ผ log๐ผ
๐ฝ+ 1 โ ๐ผ log
1โ๐ผ
1โ๐ฝfor ๐ผ, ๐ฝ โ [0,1]
๐ฟ๐ โ๐ โค ๐ฟ๐ โ๐ +2๐ฟ๐ โ๐ ๐พ๐ฟ ๐๐ + log
2๐๐ฟ
๐ โ 1+2 ๐พ๐ฟ ๐๐ + log
2๐๐ฟ
๐โ 1
โข This generalizes the realizable case (๐ฟ๐ โ๐ = 0, and so only the 1
๐term
appears) and the agnostic case (where the 1 ๐ term is dominant)
โข Numerically much tighter
โข Can also be used as a tail bound instead of Hoeffding or Bernstein also with cardinality or VC-based guarantees. Arises naturally in PAC-Bayes.