Skip to main content

Computational Learning Theory & PAC Learning

Source: Unit 5 §10

Computational learning theory (CoLT)

CoLT studies the complexity of learning algorithms - a theoretical analysis of when learning can succeed and when it is impossible.

FactsThe big questions
  • Is a model always capable of learning? How many instances are sufficient? When is learning impossible?
  • Can we identify inherently hard and easy problem classes, independently of the algorithm used?
QuantityQuestion it answers
Sample ComplexityHow many training examples are needed to converge, with high probability?
Computational ComplexityHow much compute is needed to converge?
Mistake BoundHow many misclassifications happen before converging?
Exam cueThe two areas that get examined

PAC Learning and VC Dimension. Their applications are worth remembering too: PAC underpins boosting, and VC theory underpins SVMs.

The PAC problem setting

We are given instances XX, hypotheses HH, target concepts CC where c:X{0,1}c: X \to \{0, 1\}, and a fixed, unknown distribution DD over XX. The learner LL sees examples x,c(x)\langle x, c(x) \rangle and outputs a hypothesis hh that estimates cc, which is then evaluated on new instances drawn from DD.

ErrorDefinition
Training errorWhether h(x) = c(x) on the training instances
**True error error_D(h)**The probability that h misclassifies an instance drawn at random from D

Two relaxations: why "probably approximately correct"

FactsWhat each word gives up
  1. Approximately - we do not demand zero error, just error bounded by ε\varepsilon, a small number.
  2. Probably - we do not demand success on every sample, just a failure probability bounded by δ\delta.
APPROXIMATELYwe do not demand zero error, only error bounded by εacceptableεtoo much error to accept0error_D(h) = 1PROBABLYwe do not demand success on every sample, only failure bounded by δ1 − δ : the learner succeedsδunlucky sampleP[ Pr(c(x) ≠ h(x)) ≤ ε ] ≥ 1 − δ
PAC drops two impossible demands at once: exact correctness becomes error under ε, and guaranteed success becomes success with probability 1 − δ.

The PAC framework

A concept class CC is PAC-learnable by LL using HH if, for all cCc \in C, for all distributions DD, and for 0ε,δ120 \le \varepsilon, \delta \le \tfrac{1}{2}, the learner LL outputs a hypothesis hHh \in H with errorD(h)ε\text{error}_D(h) \le \varepsilon, with probability at least (1δ)(1 - \delta), in time polynomial in 1/ε1/\varepsilon, 1/δ1/\delta, nn and size(c)\text{size}(c).

P[Pr(c(x)h(x))ε]1δP\left[\, \Pr\big(c(x) \neq h(x)\big) \le \varepsilon \,\right] \ge 1 - \delta
FactsThe two things we expect from L
  1. Output hh with high probability (1δ)(1 - \delta) and low error ε\varepsilon.
  2. Do it in efficient time - polynomial in 1/ε1/\varepsilon, 1/δ1/\delta, nn and size(c)\text{size}(c).
GotchaNo free lunch

To guarantee that the hypothesis is correct on all instances you would have to check all the examples. Generalization is impossible without assumptions, which is precisely why the PAC guarantee is stated in terms of ε\varepsilon and δ\delta rather than certainty.

Sample complexity for consistent learners

A consistent learner outputs an hh that fits the training examples perfectly whenever that is possible, so hVSH,Dh \in VS_{H,D}, the version space.

ε-exhausted version space: VSH,DVS_{H,D} is ε-exhausted with respect to cc and DD if every hh in it has errorD(h)<ε\text{error}_D(h) < \varepsilon.

NOT ε-exhaustedHYPOTHESIS SPACE Hversion spaceerror > εoutside VS, inconsistentε-exhaustedHYPOTHESIS SPACE Hversion spaceoutside VS, inconsistentgreen = true error below ε · red = true error above ε
The version space is ε-exhausted when no hypothesis inside it still has true error above ε. Haussler bounds how often m examples fail to reach that state.

Haussler's Theorem (1988) - for finite HH and mm i.i.d. examples:

P(VSH,D is NOT ε-exhausted)HeεmP\big(VS_{H,D} \text{ is NOT } \varepsilon\text{-exhausted}\big) \le |H| \, e^{-\varepsilon m}
StepsDerivation sketch
  1. A "bad" hypothesis - one with error>ε\text{error} > \varepsilon - is consistent with a single example with probability at most (1ε)(1 - \varepsilon).
  2. So it is consistent with all mm examples with probability at most (1ε)m(1 - \varepsilon)^m.
  3. With kHk \le |H| bad hypotheses, the union bound gives at most H(1ε)m|H|(1 - \varepsilon)^m.
  4. Using 1εeε1 - \varepsilon \le e^{-\varepsilon}, this is at most Heεm|H| e^{-\varepsilon m}.
  5. Set the failure probability to at most δ\delta: Heεmδ|H| e^{-\varepsilon m} \le \delta, and solve for mm.

Sample complexity bound:

m1ε(lnH+ln1δ)m \ge \frac{1}{\varepsilon}\left( \ln|H| + \ln\frac{1}{\delta} \right)
Exam cueHow the bound scales

Sample complexity grows as the natural log of H|H|, as ln(1/δ)\ln(1/\delta), and linearly in 1/ε1/\varepsilon. Halving the error you will tolerate doubles the data you need; halving the failure probability barely costs anything.