🌏 中文版
Video status: Videos included. This article is written from the official MOOC handout 06_handout.pdf and transcripts of this lecture's four official videos, with formulas following the handout. The transcripts are machine transcripts made for this article (Whisper), not official captions, and no human has proofread them. The videos are taught in Mandarin; the slides are in English. Each section opens with its official video and the approximate time ranges. Page numbers refer to the number at the lower right of each slide (0/27 to 27/27), and wherever the text says "in the lecture" it is paraphrasing what is said in the video.
This is Foundations Lecture 6 in Reading NTU Hsuan-Tien Lin Machine Learning Foundations & Techniques. The Roadmap on page 1 of the handout places it under the second of the four big questions, Why Can Machines Learn?, right after Foundations Lecture 5: Training versus Testing. On that same page, the previous lecture's conclusion is one line carrying the word "(wishfully)": the effective price of choice in training is, we hope, the growth function with a break point. This lecture turns that hope into a theorem. In the lecture's opening, Lin glosses generalization in everyday terms as inferring other cases from one example, and splits today's task into two questions:
- Does the growth function grow slowly enough?
- If it does, can it replace the in Hoeffding's inequality, which may be infinite?
The first three sections answer the first question, and the last section answers the second.
The prerequisites are four terms from the previous lecture: dichotomy (one ○× pattern that a hypothesis draws on points), growth function (the largest number of dichotomies on points), shatter (all patterns appear on some points), and break point (a such that no points can be shattered), together with Hoeffding's inequality and the union bound from Foundations Lecture 4: Feasibility of Learning. The only mathematics used is the binomial coefficient and mathematical induction. After reading, you should be able to fill in the table of the bounding function yourself, derive the recurrence inequality and the polynomial upper bound from scratch, and say which step of the proof each of the three constants in the VC bound, 4, , and , comes from.
How much one break point restricts the cases with more points
(Video 00:17–04:50 reviews the growth function and the four examples, 04:50–11:22 is the three-point experiment, 11:22–13:11 covers the idea this section arrives at, and Fun Time follows.)
Review: the break points of four hypothesis sets
Page 2 of the handout lists the four examples computed in the previous lecture side by side:
| Hypothesis set | Growth function | Pattern it cannot produce | Break point |
|---|---|---|---|
| positive rays | two points as ○× | 2 () | |
| positive intervals | three points as ○×○ | 3 () | |
| convex sets | none | none | |
| 2D perceptrons | less than for some | four points, same sign on each diagonal | 4 () |
In the lecture, Lin calls the break point the point where a first ray of hope shows: it is where the growth function first falls below . The previous lecture never worked out what the growth function of 2D perceptrons looks like; it only established that its break point is at 4.
The previous lecture already showed that if is a break point, then so are , , and so on. At the bottom of the page the handout asks: what else? What more does one break point restrict about the cases with more points?
Experiment: with minimum break point 2, how many dichotomies on three points
Page 3 runs a thought experiment. Suppose all we know about some hypothesis set is that its minimum break point is , and nothing else.
- : . The reason given in the lecture is that the minimum break point is at 2, so 1 is not yet a break point and one point can be shattered.
- : , which is the definition of a break point, so at most 3.
- : at most how many?
On three points, "" means that for each of the three pairs , , and , the four patterns ○○, ○×, ×○, ×× must not all appear. The lecture treats this as a puzzle: add dichotomies one at a time, and after each addition check whether the condition has been violated. The handout draws the process on nine slides (all numbered page 3), summarized in the table below:
| Dichotomies collected so far () | Which two points are shattered | Allowed? |
|---|---|---|
| ○○○ | none (only 1 dichotomy, 4 patterns are impossible) | yes |
| ○○○, ○○× | none | yes |
| ○○○, ○○×, ○×○ | none | yes |
| ○○○, ○○×, ○×○, ○×× | : ○○, ○×, ×○, ×× all appear | no |
| ○○○, ○○×, ○×○, ×○○ | none | yes |
| the four in row five plus ×○× | no | |
| the four in row five plus ××○ | no | |
| the four in row five plus ××× | (the pair the slide marks; the other two pairs are in fact shattered as well) | no |
The lecture adds a labor-saving observation: shattering two points takes at least four different dichotomies, so nothing needs checking until the fourth one comes in; up to three there can be no violation.
Take row five and verify it yourself. On the four dichotomies are ○○, ○○, ○×, ×○, only three distinct patterns; on they are ○○, ○×, ○○, ×○, three patterns; on they are ○○, ○×, ×○, ○○, three patterns. All three pairs are missing ××, so no two points are shattered.
Three points have only dichotomies in total. Row five uses four of them, leaving ○××, ×○×, ××○, ×××. The last three rows of the table together with row four (where ○×× gets shattered) show that none of these four can be added. The conclusion on the handout's last slide is maximum possible so far: 4 dichotomies, with a sad face drawn under each of the three columns. In the lecture, Lin says the four dichotomies chosen earlier might be swapped for a different combination, but however you swap, four is the limit. Lin also points out what the number means: the dichotomies an actual hypothesis set produces need not be these four, and there may be fewer than four; 4 is the maximum under the condition that no two points can be shattered.
A check made for this article: a Python script examined all subsets of the 8 dichotomies. The largest subsets in which no two points are shattered contain 4 dichotomies, and the handout's set is not the only one that reaches 4. Another example that is easy to read is positive rays itself: on three points ordered left to right it produces ○○○, ×○○, ××○, ×××, exactly 4.
The idea this experiment leads to
Page 4 puts the three numbers side by side:
| Maximum possible () | With no restriction | |
|---|---|---|
| 1 | 2 | 2 |
| 2 | 3 | 4 |
| 3 | 4 | 8 |
At , 3 and 4 differ only slightly; at , 4 is already half of 8. The handout puts it as break point restricts maximum possible a lot for ; the explanation in the lecture is that with more points, every combination of points adds its own "cannot shatter" condition. At there are already three pairs of points to protect at once.
This gives the route for the lecture (page 4):
The growth function depends on the details of the hypothesis set and is hard to compute directly. The quantity in the middle depends only on . If we can prove that the middle quantity is a polynomial in , then every hypothesis set with a break point is bounded by a polynomial.
Fun Time: not even one point can be shattered
Question (page 5): When minimum break point , what is the maximum possible when ?
- 1
- 2
- 4
- 8
Answer: 1. means the hypothesis set cannot even shatter one point, so ○ and × cannot both appear on any single point. Lay the dichotomies out as rows of a table, and this says every "column" may contain only one symbol. Next to the reference answer the handout draws two rows, ○×○ and ○××: in the column one of them has ○ and the other ×, so is shattered. In the lecture, Lin explains that a second dichotomy has to differ from the first on some point, and that point then has both ○ and ×, violating the condition. So there can be only 1.
The other three choices (2, 4, and 8 dichotomies) each contain at least two dichotomies, and none escapes the argument above. The result has nothing to do with being 3; it holds for every , and it will be used when filling in the table of .
Defining "maximum possible" as the bounding function and filling in the easy cells
(Video 00:00–02:26 defines the bounding function, 02:26–05:58 fills in the boundary of the table, and Fun Time follows.)
The definition of the bounding function B(N, k)
Page 6 of the handout gives "maximum possible" a name. The bounding function is the maximum possible when the break point is .
The handout stresses that it is a combinatorial quantity: the maximum number of length- vectors with (○, ×) while "no shatter" any length- subvectors. The lecture describes it as covering up some dimensions of the vectors and looking at only of them; whichever you look at, you must not see all patterns.
This definition never mentions the hypothesis set. The handout's example is that bounds two sets that look very different: positive intervals have break point 3, and 1D perceptrons also have break point 3. In the lecture, Lin says this removes the need to study separately how to analyze intervals and how to analyze perceptrons; you take the single number, the break point, and look up .
In the new notation, the results of the earlier three-point experiment read and . The new goal (page 6):
Filling the table: four kinds of cells that take no effort
Pages 7 to 10 arrange in a table, with as rows and as columns, and fill it in step by step.
The two known cells (page 7). and .
The first column, (page 8). , which is the conclusion of the Fun Time just above.
The upper right, (page 9). . There are fewer points than , so you cannot even pick distinct points to check. In the lecture, Lin says that in this case the condition "no points can be shattered" might as well not have been written, so all dichotomies can be included.
The diagonal, (page 10). . Here there is only one way to pick points, namely all of them. They cannot be shattered, so the count cannot be ; remove any single dichotomy and the remaining no longer shatter them, and no larger number is possible. The lecture checks this against numbers already computed: for two points, 4 is not allowed and removing one gives 3; for three points, 8 is not allowed and removing one gives 7.
The table after these steps (page 10):
| (rows) / (columns) | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 2 | 2 | 2 | 2 |
| 2 | 1 | 3 | 4 | 4 | 4 | 4 |
| 3 | 1 | 4 | 7 | 8 | 8 | 8 |
| 4 | 1 | 15 | 16 | 16 | ||
| 5 | 1 | 31 | 32 | |||
| 6 | 1 | 63 |
At the bottom of the page the handout writes more than halfway done. The lecture adds that the part still unfilled is the main event. On the table that is the lower left, the cells with . (An addition in this article: this is exactly the part that matters for learning, because in real problems the amount of data is far larger than the break point .)
Fun Time: 2D perceptrons and B(4, 4)
Question (page 11): For the 2D perceptrons, which of the following claim is true?
- minimum break point
- when minimum break point
- when minimum break point
Answer: 3. The minimum break point for 2D perceptrons is 4, with ; from the table, . .
The other choices: choice 1 is wrong because two points, and three points (not collinear), can both be shattered by lines, so neither 2 nor 3 is a break point. Choice 2 writes 14 as 15; on four points, what lines cannot produce are the two patterns with the same sign on each diagonal, and . Choice 4 cannot happen: is by definition the "maximum possible ", so the growth function cannot exceed it.
The message to take from this question is in the last sentence of the handout's answer: the bounding function can be "loose". only says "remove one and it is legal", while 2D perceptrons, for geometric reasons, actually lose two. In the lecture, Lin explains that is an upper limit on the growth function, and equality need not hold.
The remaining cells: reducing B(4, 3) to the row above
(Video 00:01–02:18 finds by program, 02:18–08:17 groups the 11 dichotomies and obtains two inequalities, 08:17–10:00 generalizes to the recurrence and fills the table, 10:00–12:20 is the theorem on the polynomial upper bound, 12:20–13:58 goes back to check three examples, and Fun Time follows. The title of this video on YouTube says Inductive; the section's name in the handout is Bounding Function: Inductive Cases.)
The answer first: B(4, 3) is 11
Page 12 takes the empty cell as its example. The motivation: four points with no three shattered should be related to the "three points" row, because four points with one covered up are three points. The goal is to reduce to .
How to do the reduction is not easy to see directly, so the lecture finds the answer first and then studies it. Lin says that, coming from a computer science department, the natural move is to write a small program: there are 16 length-4 ○× vectors; pick some of them as a set of dichotomies, check whether any three points are shattered, and find the largest such set. There are sets to check, written in the handout as , which is quick for a computer. Page 13 lists the winner, 11 dichotomies in all:
| No. | ||||
|---|---|---|---|---|
| 01 | ○ | ○ | ○ | ○ |
| 02 | × | ○ | ○ | ○ |
| 03 | ○ | × | ○ | ○ |
| 04 | ○ | ○ | × | ○ |
| 05 | ○ | ○ | ○ | × |
| 06 | × | × | ○ | × |
| 07 | × | ○ | × | ○ |
| 08 | × | ○ | ○ | × |
| 09 | ○ | × | × | ○ |
| 10 | ○ | × | ○ | × |
| 11 | ○ | ○ | × | × |
So . On the table, directly above is and to the upper left is , and . In the lecture, Lin says this cannot be treated as a game of making numbers add up; to claim that 11 is 4 plus 7, you have to give a reason.
A check made for this article: following the same approach, a Python script enumerated all subsets. The largest legal subsets do contain 11 dichotomies, and the handout's set passes the check. It is not the only subset that reaches 11 (later we will see that the 11 dichotomies of positive intervals on four points form another one), and the argument below holds for any of them.
Splitting by the last point into "pairs" and "singles"
Page 14 reorders the 11 rows. The grouping is based on what the first three points look like:
- Pair (orange on the slide): the first three symbols are the same, and is ○ in one row and × in the other. These are 01 and 05 (○○○), 02 and 08 (×○○), 03 and 10 (○×○), 04 and 11 (○○×): 4 pairs, 8 rows.
- Single (purple): the first three symbols appear only once in the whole table. These are 06 (××○, with being ×), 07 (×○×, with being ○), and 09 (○××, with being ○): 3 rows.
The lecture's words for the two groups are Mandarin idioms meaning "coming in pairs" and "all alone". Write for the number of pairs and for the number of singles (page 15):
The first inequality: after covering x₄
Cover the column and look only at the first three points (page 15). The two rows of each pair become the same row and count once; each single counts once. So there are different dichotomies on the first three points:
| Source | What it looks like on |
|---|---|
| (first three symbols of the pairs) | ○○○, ×○○, ○×○, ○○× |
| (first three symbols of the singles) | ××○, ×○×, ○×× |
The original 11 rows "no shatter" any three points, and is of course one such triple. So these dichotomies on three points cannot shatter those three points either, and their number cannot exceed the maximum for "three points, no three shattered":
In this example , exactly equality.
The second inequality: looking only at the paired half
Do it once more. This time, besides covering , also throw away the singles and keep only the four dichotomies of (page 16). The handout claims that these dichotomies, on the first three points, cannot shatter any two points.
The reason is by contradiction. Suppose the dichotomies shatter some two of the first three points, say , meaning ○○, ○×, ×○, ×× all appear on those two points. Every dichotomy in has two versions in the original table, one with being ○ and one with being ×, so all patterns appear on , three points are shattered, and this contradicts the original condition. The lecture puts it bluntly: two shattered points, combined with the paired , are three shattered points, and then we are done for. So
Verify it in this example: for the four dichotomies ○○○, ×○○, ○×○, ○○×, any two points show only the three patterns ○○, ○×, ×○, with ×× missing. , again equality. These four also happen to be the very set that survived to the end of the earlier three-point experiment, only with the rows in a different order.
The first inequality uses "cover one point, and the in the condition stays the same"; the second uses the extra information of pairing to get a stricter condition, with lowered by 1. Neither can be dropped: with only the first, what you get is , which doubles with every additional point, so the upper bound is still exponential.
Putting it together: the recurrence inequality
Page 17 stacks the three lines:
The second slide on the same page replaces 4 with and 3 with . In the lecture, Lin says not a word of the proof has to change; the only difference is that the largest set of dichotomies no longer comes out of a computer but is one we imagine: it can always be split by into pairs and singles.
Here is the reasoning for the general case written out in full (an addition in this article; the handout only lists the formulas). Let be a set of dichotomies that achieves . Covering gives dichotomies of length , and no of the first points were shattered by to begin with, so . If the paired dichotomies shattered some of the first points, then adding would shatter points, a contradiction, so . This argument needs and .
On the table, the inequality says that each cell is at most "the cell directly above" plus "the cell to the upper left". Use it to fill the lower left (page 17):
| (rows) / (columns) | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 2 | 2 | 2 | 2 |
| 2 | 1 | 3 | 4 | 4 | 4 | 4 |
| 3 | 1 | 4 | 7 | 8 | 8 | 8 |
| 4 | 1 | ≤ 5 | 11 | 15 | 16 | 16 |
| 5 | 1 | ≤ 6 | ≤ 16 | ≤ 26 | 31 | 32 |
| 6 | 1 | ≤ 7 | ≤ 22 | ≤ 42 | ≤ 57 | 63 |
Cell by cell: ; ; ; ; ; ; ; . Note that the 5 used for is itself an upper bound; in the lecture, Lin explains that from two upper bounds you can estimate the next upper bound. Lin sums up the chain of relations this way: the growth function is bounded by the bounding function, and the bounding function is bounded by "a bound on the bound".
The theorem: the bounding function is bounded by a polynomial
The theorem on page 18:
The handout says the proof is simple induction using boundary and inductive formula, and the lecture likewise calls it a very simple induction without going through it. It is written out below (the steps are supplied by this article). By convention, when .
The column . The right side has only the term, , and . It holds.
The row . has been covered. For , , and the right side is . It holds.
Inductive step. Let and , and assume every cell in row holds. Use the recurrence inequality, then substitute the induction hypothesis into both terms:
Shift the index of the second sum by one and write it as . Take the term out of the first sum, and pair the rest term by term with the second sum:
Two facts are used in the middle: , and the Pascal's triangle identity (choosing out of things splits into the cases "do not choose the last one" and "choose the last one"). Row holds, and the induction is complete.
The recurrence "above plus upper left" has the same shape as the rule that generates Pascal's triangle, which is why binomial coefficients appear on the right side.
Why this is a polynomial. For fixed , the term of highest degree in the sum is the last one,
It is a polynomial in of degree , and the handout labels the sum with highest term . Hence (page 18): for fixed , is upper bounded by , so is polynomial if a break point exists. The lecture's conclusion is that once the growth function has that point where a ray of hope shows, there is nothing to fear: in the end it must be polynomial.
Check against the table: for , at is ; for , adding gives at . These agree with the numbers on the table.
On the same page the handout writes that "≤" can be "=" actually, and that math lovers should go and prove it. The lecture adds that what needs proving is the other direction (≥), and the technique differs from the one here. An addition in this article, an idea that shows why the ≥ direction holds: collect all vectors in which "the number of × is at most " into one set, vectors in all; for any points to be shattered, a vector with × on all of those points would have to appear, but such a vector has at least × and is not in the set. For and this set has vectors, and a program written for this article checked that it does not shatter any three points. So the numbers on the table marked "≤" are all the true values.
Applying it to a concrete hypothesis set: positive intervals on four points
What follows is an example made up for this article, not from the slides, to see what the , argument looks like on a real hypothesis set. Positive intervals have break point 3, and on four points ordered left to right there are dichotomies: the all-× one, plus the in which the ○ form one contiguous run. Grouped by the first three points:
| First three symbols | is ○ | is × | Group |
|---|---|---|---|
| ××× | ×××○ | ×××× | pair |
| ××○ | ××○○ | ××○× | pair |
| ×○○ | ×○○○ | ×○○× | pair |
| ○○○ | ○○○○ | ○○○× | pair |
| ○×× | impossible (the ○ are not contiguous) | ○××× | single |
| ×○× | impossible | ×○×× | single |
| ○○× | impossible | ○○×× | single |
, , and . The first three symbols of the pairs are ×××, ××○, ×○○, ○○○; on any two points the pattern ○× (○ on the left, × on the right) is missing, so no two points are shattered, and . All seven sets of first three symbols are exactly positive intervals on three points, and .
What this result means: positive intervals on four points use up all of . Their 11 dichotomies and the 11 found by the handout's program are two different sets, yet after grouping, and are the same, and both inequalities hold with equality. Why the paired half is subject only to the restriction is easy to see here: for the last point to accept both symbols, the first three points must either be all × or have ○ running all the way to the right end. That is precisely the look of positive rays, with a single boundary, and the break point of positive rays is 2.
Going back to check three examples
Page 19 applies the theorem to the opening examples (convex sets have no break point, so this page is called The Three Break Points):
| Hypothesis set | The true | The theorem's upper bound | |
|---|---|---|---|
| positive rays | 2 | ||
| positive intervals | 3 | ||
| 2D perceptrons | 4 | not yet known |
In the first two rows the upper bound equals the true value. Expand the upper bound in the third row once:
The coefficient is , and the coefficient is . Substituting gives , which is .
In the lecture, Lin says the first two rows are not the point, since their growth functions could be written down anyway. What matters is the third row: we still cannot write down the growth function of 2D perceptrons, yet from the single number "the break point is 4" we know it grows at most like . The conclusion at the bottom of the handout page is can bound by only one break point.
Fun Time: is the upper bound loose for 1D perceptrons
Question (page 20): For 1D perceptrons (positive and negative rays), we know that . Let be the minimum break point. Which of the following is not true?
- for some integers ,
- for all integers ,
- for all integers ,
Answer: 3. The handout says the proof is generally trivial by listing the definitions; here the listing is carried out.
- Choice 1 is true: , so two points can be shattered; . The minimum break point is 3.
- For the upper bound is . Compared with :
| Upper bound | ||
|---|---|---|
| 1 | 2 | 2 |
| 2 | 4 | 4 |
| 3 | 6 | 7 |
| 4 | 8 | 11 |
| 5 | 10 | 16 |
- Choice 2 is true: they are equal at and .
- Choice 4 is true: the upper bound minus is , which is positive for .
- Choice 3 says they are equal for every , which already fails at (6 versus 7).
With the same , positive intervals use up the upper bound while 1D perceptrons grow only linearly. The bounding function looks only at the break point, so for the latter it is very loose.
How the growth function replaces M: the three-step pictorial proof of the VC bound
(Video 00:00–01:56 shows what the final formula looks like and how this section will go, 01:56–06:39 is step one, 06:39–09:28 step two, 09:28–11:29 step three, 11:29–13:37 is the VC bound and 2D perceptrons, 13:37–14:35 is Fun Time, and the summary follows.)
The formula we want and the formula we actually get
The first question now has an answer: with a break point, the growth function is polynomial. The second question is putting it into Hoeffding. The result of Foundations Lecture 4 for finitely many hypotheses is . The most direct wish is to replace with (the want on page 21 of the handout):
In the lecture, Lin says things are not that simple. What can actually be proved is a version that looks similar (the actually on page 21), and it requires large enough:
Three constants have been added: an extra 2 in front, the argument of changing from to , and an extra in the exponent.
The handout calls what comes next a sketch of proof. The lecture first makes clear where this section stands: the full proof is very technical, and Lin does not think everyone should spend the effort to understand every mathematical detail, so the lecture only accounts for which technique brings in each of the three constants and leaves out the underlying mathematics; anyone interested has to write out the details on their own. This article keeps to the same scope. It adds a few sentences of reasoning the handout does not write down, but it is likewise not a rigorous proof.
Below, is abbreviated as BAD, as on page 23 of the handout. It means: the data we drew makes and differ by more than for at least one in the hypothesis set.
Step 1: Replace Eout by E′in
Why not just sort the hypotheses into kinds and apply the union bound? The first point on page 22 of the handout: finitely many, infinitely many. The explanation in the lecture is that depends only on the examples, and two hypotheses with the same dichotomy on these points have the same , so there are at most values; , however, depends on the whole input space, and turning a line in the plane slightly already changes . In other words, two hypotheses with the same still have different , so whether BAD happens may differ between them too, and they cannot be lumped into one kind. The handout calls evil; it has to be replaced first.
The replacement is to sample another data set of the same size (the handout calls it the verification set), compute on it, and use that in place of . In the lecture, Lin says this is the verification discussed before: to learn roughly what is from finitely many points, take another batch of data and estimate with it. is usually called ghost data; the lecture stresses that it is not data that actually exists, only an imagined second draw.
The figure on this page of the handout is a bell-shaped curve showing the probability distribution of and , centered at . is marked on the right tail, far from the center, which is the situation where BAD happens; the half to the left of the center line is shaded, and is marked on that side. The lecture's account: the values computed from different data sets are roughly centered at , some farther and some nearer; if is far from , then the from another draw has a good chance of being far from too, and Lin says the picture looks like a chance of somewhat more than one half. Reading it off the figure (this article's reading): when lands on the other side of , it is even farther from than is. The handout writes that BAD of probably implies BAD of . As a formula:
Compared with the original, three things changed: became ; the left side gained a , which the lecture ties to the "good chance" just mentioned, since it is not certain to happen; and the threshold went from to , about which the lecture only says it is a mathematical necessity.
An addition in this article on where and " large enough" come from (neither the handout nor the lecture expands on this). Suppose makes some go wrong, . This was picked after looking at , but is drawn separately and independently, so from the point of view of it is a hypothesis fixed in advance, and the single-hypothesis Hoeffding of Foundations Lecture 4 applies (with replaced by ): the probability that is at least . When that happens, the triangle inequality gives
So as long as , that is, , whenever the original BAD happens there is at least a one-half chance that the new BAD happens along with it. The probability of the new BAD is therefore no less than half the probability of the original BAD, which is the formula above. For this threshold is . The handout's " large enough" gives no number; the threshold here is the condition this particular argument uses, and it does not mean the full proof adopts the same one. Setting the threshold at leaves a margin: itself deviates from , and if it is allowed to deviate by , the remaining gap is still .
Step 2: Decompose H by Kind
Move the to the right side (page 23):
The event inside the brackets now depends only on the points of and . In the lecture, Lin explains that if two hypotheses have the same dichotomy on these points, their are the same and their are the same, so they go wrong or not in perfect step. The infinite can therefore be divided into
kinds. Take one representative of each kind and apply the union bound to these finitely many representatives:
The argument of is because we are now looking at the number of points in the two data sets combined.
This page of the handout has three small pictures side by side. In each, the box stands for all possible data sets, and is one point in it:
| Picture | What is drawn | Meaning |
|---|---|---|
| (a) Hoeffding Inequality | one small blob in the box | the bad data sets of a single take up only a small patch |
| (b) Union Bound | many blobs, not overlapping, filling the box | adding up each 's bad data sets as if they never overlapped, infinitely many cover everything |
| (c) Now | many blobs stacked in the same region | the bad data sets of of the same kind nearly coincide, so one kind is counted only once |
In the lecture, Lin says the technique in this step is the same as when the union bound was used in Foundations Lecture 4, except that the growth function has to be applied first so that a finite count can be pulled out and the amount of overlap among bad events worked out properly. The line at the bottom of the handout page is use to calculate BAD-overlap properly.
An addition in this article: the representative of each kind can be chosen only after the points are fixed, so the "fixed " here is stated conditionally on those points being given. This is also why step three switches to the picture of a bin: once the points are given, the remaining randomness is "which go to and which go to ". The handout does not write this conditioning out, and this article only points to it without working through the details of the conditional probability.
Step 3: Use Hoeffding without Replacement
What remains is, for one fixed , to estimate the probability that the two samples differ by more than . The approach on page 24 of the handout: think of the examples as a small bin, choose of them to compute , and leave the other in the bin for . The fraction of the bin on which errs is the average over all examples, namely . Because
we have
The right side says that "the fraction in the sample" and "the fraction in the bin" differ by more than , which is exactly what Hoeffding handles. The handout lists three differences from Foundations Lecture 4: a smaller bin (only examples), a smaller (), and sampling without replacement (Hoeffding without replacement). The lecture explains what without replacement means: draw one orange marble and the fraction of orange in the bin drops a little, unlike the original setup where the probability is the same on every draw; still, this version of Hoeffding ends with a result the same as or similar to the original. Substituting for the in :
A numerical example of the small bin
What follows is an example made up for this article, not from the slides, to see the equivalence in step three and the actual size of the inequality. Take , so the bin holds examples. Some fixed errs on 8 of them, so the error fraction of the bin is . Draw 10 at random as ; if errs on of them, then and . Take , so the thresholds are and .
The number of ways to draw errors is , out of draws in total:
| Number of ways | Over the threshold? | |||
|---|---|---|---|---|
| 0 | 66 | 0.8 | 0.4 | yes |
| 1 | 1,760 | 0.6 | 0.3 | yes |
| 2 | 13,860 | 0.4 | 0.2 | no (exactly equal) |
| 3 | 44,352 | 0.2 | 0.1 | no |
| 4 | 64,680 | 0 | 0 | no |
| 5 | 44,352 | 0.2 | 0.1 | no |
| 6 | 13,860 | 0.4 | 0.2 | no (exactly equal) |
| 7 | 1,760 | 0.6 | 0.3 | yes |
| 8 | 66 | 0.8 | 0.4 | yes |
The third column is always twice the fourth, so "third column greater than 0.4" and "fourth column greater than 0.2" pick out the same four rows, which is the equivalence above. The true probability is
The upper bound from step three is .
This result means two things. The inequality holds, . It is also very loose, off by a factor of more than forty; Hoeffding uses only the general fact that "a sample average deviates from the population average" and none of the details of this particular bin. Looseness of this kind is present in all three steps, and the Fun Time below shows its accumulated effect.
Putting it together: the VC bound
Multiply the constants of the three steps, and , and you get the Vapnik-Chervonenkis (VC) bound on page 25:
| Step | What it does | Constants it leaves |
|---|---|---|
| 1 | replace by | an extra 2 in front, becomes |
| 2 | decompose by kind | becomes |
| 3 | use Hoeffding without replacement | another 2, becomes , and after squaring the exponent holds |
In the lecture, Lin calls this a very important theorem proved in a very hand-waving way, and introduces Vapnik and Chervonenkis as two very important figures in machine learning theory.
The same page then plugs in 2D perceptrons: the break point is 4, and is . A polynomial times : for large enough the exponential term wins, and the probability of the bad event goes to 0. The handout's conclusion is learning with 2D perceptrons feasible. The lecture connects this back to the algorithm: with enough data, pick the hypothesis with the smallest and its will probably be small too, so the PLA of Foundations Lecture 2: Perceptrons and PLA really does learn something on two-dimensional data. Lin also points out that only two dimensions have been proved so far; where the break point of perceptrons in arbitrary dimension lies has not yet been covered.
Fun Time: the VC bound with ten thousand examples
Question (page 26): For positive rays, . Plug it into the VC bound for and . What is VC bound of BAD events?
Answer: 3. The handout only writes simple calculation; the arithmetic is:
- , and .
- The exponent is , and .
- Multiplying: .
The other choices (the matches below were worked out for this article; the handout does not explain them): choice 1 is Hoeffding with a single hypothesis, . Choice 2 puts the growth function straight into the original exponent, for example , without changing the exponent to . Choice 4 is greater than 1, and this article found no formula that produces it; an upper bound on a probability that exceeds 1 provides no information.
Choices 1 and 2 differ from the correct answer by more than eighty orders of magnitude, and the whole difference is in the exponent: becomes , smaller by a factor of 16. The handout's note is that the BAD probability bound is not very small even with 10000 examples. The explanation in the lecture is that the derivation used many approximations, so this bound is not necessarily that accurate; why it is still worth so much effort to derive when it is not accurate is left for the next lecture.
Plugging in 2D perceptrons
What follows is a calculation made up for this article, not from the slides. Use the upper bound from page 19, , again with :
| Upper bound on | VC bound | ||
|---|---|---|---|
| 10,000 | about | about | |
| 20,000 | about | about | |
| 30,000 | about | about | |
| 100,000 | about | about |
What this result means: at the upper bound is twenty million, far greater than 1, and guarantees nothing; as goes from twenty thousand to thirty thousand, the bound falls from 593 to 0.0075. Trying values one by one, the bound first drops to 1 or below at , and first drops to 0.05 or below at . Over this range the polynomial term grows only a little more than threefold, while the exponential term shrinks by a factor of about for every additional ten thousand examples. This is what "a polynomial eventually loses to an exponential" looks like in practice.
Note that these numbers are the amount of data the guarantee needs, not the amount of data needed in practice to learn a 2D perceptron. The reasons the bound is loose have all appeared earlier: can be larger than the true growth function, the union bound counts overlapping bad events more than once, and Hoeffding itself is loose.
The summary on page 27 condenses each of the four sections into a line: break point "breaks" consequent points; bounds with break point ; is ; can replace with a few changes. The preview of the next lecture is how to "use" the break point.
Self-check
1. When the minimum break point is , what is the largest number of dichotomies on four points? Write down a set of dichotomies that reaches this number.
Answer: the recurrence inequality gives . Positive rays on four points ordered left to right produce ○○○○, ×○○○, ××○○, ×××○, ××××, 5 in all; on any two points "○ on the left, × on the right" is missing, so no two points are shattered. The upper bound is therefore attained, , which also equals the theorem's . (This article confirmed by exhaustive search with a program that the maximum is 5.)
2. The table says . Without a program, show that is exactly 16.
Answer: it is enough to find one set of 16 dichotomies in which no three points are shattered. Positive intervals have break point 3 and , and their 16 dichotomies on five points form such a set. The upper bound is 16 and something reaches 16, so they are equal.
3. In deriving the recurrence inequality, why is the paired compared with and not with ? If we could only write , what would the conclusion become?
Criteria: the answer should say that every paired dichotomy has both ○ and × on , so as soon as of the first points are shattered, adding makes shattered points; hence the restriction on is one level stricter than the original. Writing only gives , at most doubling with every additional point; the upper bound is still exponential and no polynomial can be proved.
4. Positive intervals have . With , compute the VC bound for and for .
Answer: at , ; times 4 is ; times is about , greater than 1, so there is no guarantee. At , ; times 4 is ; times is about . With the growth function going from linear to quadratic, ten thousand examples go from 0.298 to no guarantee, and it takes twenty thousand to push the bound below 0.05.
5. Some fixed has on and on , with . How does each of the two forms in step three judge it? Then explain why the first step of the proof cannot be skipped.
Answer and criteria: ; the bin average is , and . Both forms judge it as over the threshold, because the second is just the first with both sides divided by 2. The reason for the first step should say: depends on the whole input space, and two hypotheses with the same dichotomy on the points can still have different , so they cannot be sorted into finitely many kinds; after switching to , the event depends only on the points, and only then can kinds be counted.
Exercises and corresponding reading
Both semesters list this lecture as optional viewing. The Fall 2026 course page lists this lecture's four videos under W4 (09/30) as "suggested watching (anytime)", whereas the previous lecture's videos are "required watching (before class)". The Fall 2024 course page puts this lecture under "optional" and lists two versions side by side: Caltech's Yaser Abu-Mostafa's Lecture 6 in English, and Lin's four segments in Mandarin. If you only want to keep reading, two conclusions are enough to carry forward: a hypothesis set with a break point has a polynomial growth function, and the VC bound is .
Textbook. According to the Fall 2024 course page, this lecture corresponds to 2.1.2 of Learning from Data (LFD).
English counterpart. Lecture 6 of Caltech Learning from Data is also called Theory of Generalization and uses the same textbook.
Homework. The bonus problem Q13 of Fall 2024 HW3 asks for a proof of the lower bound on , which is the other direction of the "≤ can be =" that page 18 of the handout leaves to the reader. Fall 2024 HW2 covers Foundations Lectures 4 to 7; its growth-function problems are discussed in the article for Foundations Lecture 5: Training versus Testing. The guide to the whole assignment is in Foundations Homework.
Hands-on. The thing most worth doing by hand in this lecture is the small program from the lecture: list the 16 length-4 ○× vectors, enumerate their subsets, find the largest subset in which no three points are shattered, and confirm that it has 11 dichotomies; change the condition to no two points and confirm that it has 5. Pure Python finishes in a few seconds.
Further reading. Stanford CS229 Lecture 6: Bias and Variance, Regularization, and Model Selection approaches the same generalization question by a different route and makes a useful comparison.
Next lecture. Foundations Lecture 7: The VC Dimension names "the largest non-break point" the VC dimension and takes up the two things this lecture leaves open: where the break point of perceptrons in arbitrary dimension lies, and why this very loose bound is still useful.
Course video sources
Original videos: Restriction of Break Point, Bounding Function: Basic Cases, Bounding Function: Inductive Cases, A Pictorial Proof
Checked: 2026-10-13. The video IDs, titles, and lengths were taken from the official playlist on that day; the videos have no caption track on YouTube, and what this article reports from the lecture comes from transcripts made for it.
Update Log
- 2026-10-13: The series now has one article per lecture; this lecture is a newly split-out article, written from the handout and the video transcripts.
References
- Foundations Lecture 6 handout, 06_handout.pdf: the main source for this article. The derivations in the four sections, the tables, the four Fun Time questions, and the descriptions of the figures all come from this handout.
- Machine Learning Foundations YouTube playlist: the IDs and titles of the four videos; what the text reports as said "in the lecture" is paraphrased from machine transcripts of these four videos.
- Hsuan-Tien Lin > MOOCs: the official entry for handouts and recordings.
- MOOC slide errata: the official errata page, worth checking against while reading the handout.
- Machine Learning, Fall 2026 course page: this lecture is listed under W4 as suggested watching.
- Machine Learning, Fall 2024 course page: this lecture is listed as optional, along with the corresponding LFD section.
- Fall 2024 Homework 3 (hw3_red.pdf): bonus problem Q13 proves the lower bound on the bounding function.
- Fall 2024 Homework 2 (hw2_red.pdf): the assignment covering Foundations Lectures 4 to 7.
- Caltech Learning from Data telecourse: the English-language course using the same textbook.
- Caltech Lecture 6 (Yaser Abu-Mostafa): the English version of Theory of Generalization listed alongside on the Fall 2024 course page.
- Learning from Data textbook website: the source of 2.1.2.
- Reading NTU Hsuan-Tien Lin Machine Learning Foundations & Techniques: Course Overview: where this lecture sits in the whole course and the reading routes.
Loading...