This lecture turns learnability into algorithms: Halving converts mistakes into elimination, Hedge balances past performance through exponential weights, partial covers turn finite Littlestone dimension into an agnostic strategy, and Perceptron uses geometric margins for an efficient guarantee. Source: lecture7.pdf (local source, not published online); companion: full handout; previous: Lecture 6. Expected regret, deterministic mistake bounds, realizability, and running time are kept distinct.
1 What the Four Methods Solve
| Method | Main condition | Guarantee | Implementation |
|---|---|---|---|
| Halving | Finite class, perfect classifier | Logarithmically many mistakes | Enumerate survivors |
| Hedge | Finite experts, bounded full-information losses | Expected square-root regret | Evaluate all expert losses |
| Generalized Halving and partial covers | Finite Littlestone dimension | At most d realizable mistakes; aggregate for agnostic learning | Dimension computation may be hard; large expert pool |
| Perceptron | Euclidean normalization and positive margin | Inverse-square-margin mistake bound | Inner product each round; vector update on mistakes |
Source pages 1–3 cover finite classes, Lemma 1, and Theorem 1; pages 4–6 cover Algorithms 1–3, Lemma 2, and Theorems 2–3; pages 7–8 cover Assumption 1, Algorithm 4, and Theorem 4.
The environment cannot choose current losses after observing the current private random draw. Observing permits evaluation of all : this is full information. If only the chosen expert’s loss is observed, the problem is bandit and needs different estimators; this proof does not directly apply.
2 Halving: A Mistake Eliminates at Least Half
Realizability means one fixed is correct in all rounds. The version space never becomes empty. Arbitrarily choosing a survivor may eliminate only one per mistake, giving . Majority vote ensures that a mistake eliminates at least half.
Starting with 16 candidates, mistakes leave at most 8,4,2,1, so at most four mistakes occur. Since the comparator has zero loss, mistake count equals regret. A fixed tie label still eliminates half on errors. The majority-vote function may lie outside the original class, making this improper, but it remains a legitimate input-to-label rule.
3 Why the Agnostic Case Needs Randomness
Two constant experts suffice. A deterministic learner’s current label is determined by history, so the environment can anticipate and negate it, forcing errors. The two constant experts’ errors sum to , so one errs at most . Regret is at least . This concerns discrete-label decisions; convexified predictions with convex loss may permit deterministic averaging, so it is not a claim about every online problem.
FTL follows the current leader too sharply. Hedge changes two things: an error reduces weight rather than eliminating the expert, and the algorithm samples according to weights rather than always selecting the leader. The low-temperature limit approaches FTL, though tied leaders may still be randomized.
4 Hedge: Executable Rule and a Worked Update
Compute the distribution, sample and act, then observe all current losses and update. With two experts and , initial weights are (1,1) and probabilities (1/2,1/2). After losses (1,0), weights become (1/2,1) and probabilities (1/3,2/3). After another (1,0), weights are (1/4,1) and probabilities (1/5,4/5). Experts are not permanently eliminated and can recover if conditions change.
This pseudocode uses a shifted softmax to avoid exponential underflow. It changes numerical implementation, not the algorithm.
loss_total = zeros(K)
for t in range(n):
logits = -eta * loss_total
weights = exp(logits - max(logits))
probabilities = weights / sum(weights)
chosen = sample(probabilities)
act(chosen)
losses = observe_all_expert_losses()
loss_total += losses5 Lemma 1: The Normalizer as a Potential
Set and . Their ratio is the exponential-loss average under the current distribution, linking the weight update to current expected loss:
The required bound is for . For , Taylor’s integral remainder is at most . For , set ; the quadratic-and-higher series is at most . This explains and permits some negative losses.
The last step uses . Sum over rounds to telescope:
Initially , hence . For any comparator , the sum contains its term, so and . Substitution gives
This is Lemma 1, simultaneously for all experts on every realized loss sequence. The squared-loss term contains more information than “at most one per round”; Theorem 1 further relaxes it to for a simple bound.
6 The Hindsight Expert Stays Inside the Expectation
Conditioned on history and the environment’s current choice, expected sampled loss is . Iterated expectation converts learner loss to expected weighted loss. The best expert depends on the random history, however, so must not be replaced by .
The lemma holds pathwise for every expert, so selecting the best expert on that path before taking expectations is legitimate. For losses in ,
The learning rate balances initial uncertainty and update cost . With , follow the single expert rather than use a zero-rate formula. A doubling-horizon restart schedule gives the same order without knowing ; that is a supplementary strategy, not an algorithm specified in the handout.
7 Generalized Halving as a Mistake Budget
An infinite class cannot vote by counting functions, but Lecture 6 shows at least one label subclass has smaller Littlestone dimension. Algorithm 1 predicts the larger-dimensional label and retains the true-label subclass. A correct prediction cannot increase dimension; an error retains the smaller side and lowers dimension by at least one.
Realizability keeps the version space nonempty and its dimension nonnegative. Starting at d permits at most d drops, proving Theorem 2. Dimension acts as a budget of forced mistakes, not parameter count. For singleton indicators, predict negative until the first positive example, after which the target is uniquely determined, giving at most one mistake. Existence does not imply efficient dimension computation.
8 From Realizable to Agnostic Learning: Enumerate Mistake Times
If the input tree were known, Hedge could run over its zero-cover. Future inputs are unknown, so a whole tree cannot be constructed. The key idea is that a realizable run disagrees with Generalized Halving on at most d rounds. Build an expert for each set of at most d rounds and flip its default prediction on those rounds. This covers every target function on every actual path.
Each expert has its own version space. After receiving an input, it computes the default Generalized Halving label, flips according to its fixed set T, and updates using its own output. True labels do not update this internal version space; they only determine the expert’s loss for outer Hedge.
current input x_t
/ | \
expert expert expert
T = ∅ T = {1} T = {2}
\ | /
Hedge sampling
|
prediction
|
true label y_t
|
update outer loss weightsThis is a supplementary sketch. Experts update themselves internally; the final arrow only updates outer weights.
9 Lemma 2: The Cover Proof by Induction
Fix a target and any actual input path. Imagine another Generalized Halving run labeled by . It is realizable, so its mistake set has size at most d and is in the expert pool. Prove that expert matches the target:
Both runs start with the same class. Suppose their version spaces agree before round t, so their default labels agree. If the default equals , then and the expert does not flip. Otherwise and it flips, again outputting . Both retain the subclass predicting , so the next spaces agree. Induction completes the proof.
Experts do not know which is correct or which target is best. Hedge maintains all candidates. The proof establishes a matching expert without requiring it to be identified beforehand. Other experts may predict impossible labels and enter an empty class; define all their later outputs as −1. The matching expert never becomes empty. Duplicate behaviors among indices only reduce the effective pool size.
10 Theorem 3: Comparator Direction and Computation
Every original function has a matching expert on the realized path, so the expert pool may perform better. Subtract both sides from the same learner loss:
This corrects the source’s statement that the regrets are the same: inequality suffices. For , it implies the handout’s , using at small horizons. For , predict the single function. History-dependent experts do not invalidate Hedge, since their current predictions are fixed before the label and current sampling are revealed.
For , there are indices. Instead of expanding 31-node trees, maintain 16 internal states. Generally is roughly , and computing dimensions adds cost. This is a constructive learnability proof, not a universally efficient algorithm.
The handout cites Hanneke, Livni, and Moran (2021) for near-optimal agnostic regret with randomized proper algorithms. That result requires additional theory; the improper construction above is not presented as a proper algorithm.
11 How Margin Changes the Impossibility Result
Lecture 6 showed online zero-one impossibility for real thresholds because the adversary can probe arbitrarily close to the boundary. A positive margin under normalization excludes that endlessly fine subdivision. Assume dual norms with
Hölder implies . Mere linear separability without a uniform lower bound permits inputs arbitrarily close to the hyperplane and does not give a fixed mistake bound. In Euclidean geometry the distance is , at least under the unit-ball restriction.
The handout first identifies zero hinge loss with unit score margin, then normalizes inputs and introduces arbitrary . Normalization does not preserve an unconditional unit-margin requirement: scaling changes scores.
12 Learning Margin Classification with a Finite Cover
Take a -net of the parameter ball of size at most . Its representative is within of the separator. Hölder gives
A classifier in the net is therefore perfect, and Halving makes at most mistakes. This is horizon-independent and logarithmic in inverse margin, but the net is exponentially large in d. The next method trades worse margin dependence for an efficient dimension-free guarantee.
13 Perceptron: A Vector Correction on Each Mistake
Fix . A mistake implies nonpositive signed score; the update increases that score by , without guaranteeing it crosses zero immediately. Not updating on correct predictions lets norm growth be charged only to mistakes. Storage is one d-dimensional vector; each inner product costs , or proportional to nonzero inputs in the sparse case.
14 Theorem 4: Two Bounds on the Same Vector
Let and . First, every mistaken update makes progress of at least toward the true separator.
Summing from zero makes alignment grow linearly in the number of mistakes. Second, each mistake increases squared norm by at most 1.
The cross term is nonpositive because an update occurs only on mistakes. The final term is at most 1 because inputs are normalized. Norm therefore grows at most as the square root of mistakes. Cauchy–Schwarz combines the two facts:
If , the result is immediate. Otherwise divide by and square to obtain , proving Theorem 4. It holds pathwise for any adaptive sequence satisfying the margin assumption, not merely in expectation.
For general scaling, if , , and , the same argument gives
15 A Worked Perceptron Example
Take separator and examples , , . All lie in the unit ball and have margin at least 0.6. With +1 predicted at zero:
The first prediction is +1 and wrong, updating to . The next two scores are both 0.6, so no update occurs. There is only one actual mistake; the bound means at most two integer mistakes. The bound need not be attained. On a sequence causing a second error, the proof still counts only mistaken updates, regardless of the number of correct rounds.
16 Sequential Fat and the Dimension Qualification
The handout ends with the claim that linear sequential fat is “of order .” First prove the dimension-free upper bound. Use the Euclidean complexity calculation from Lecture 6, avoiding confusion between a general witness tree and zero-threshold margin. If a depth-m tree is shattered at scale , choose its matching function on each path:
The witness is predictable, so every has expectation zero. Divide by m and take expectations: complexity is at least , while Euclidean linear complexity is at most . Hence
A matching lower bound needs enough dimensions. Let , use basis vector at level i, and use witness zero. For each sign vector choose . Then
Thus sfat is at least k. Only with sufficiently large d does this match . Why not claim this unconditionally in fixed low dimension? On the one-dimensional parameter interval , witnesses for two distinct paths differ by at least at their first shared branching input, hence their parameters differ by at least . A depth-m tree has paths, so
This differs sharply from an unconditional inverse-square lower bound. The derivation also explains the factor 4 caused by the convention versus a direct margin .
17 Pitfalls, Self-Test, and Reading Route
- Why does deterministic Halving not contradict the two-expert lower bound? It assumes a perfect classifier.
- Can the best Hedge expert move outside the expectation? No; the pathwise lemma lets us choose it before taking expectation.
- Do T experts internally update using true labels? No; they use their own predictions. True labels update outer weights.
- Which regret is larger? The expert benchmark can be better, so expert regret is at least original-class regret.
- Where does Perceptron’s nonpositive cross term come from? Updates occur only on mistakes, whose signed score is nonpositive.
- What fails without bounded input norm? The bound of one on each squared-norm increase.
- Is one update guaranteed to correct its example? No; only score improvement is proved.
- Does a dimension-free mistake upper bound imply a matching sfat lower bound in every dimension? No; see the one-dimensional packing argument.
Spend 20 minutes deriving Halving and the two-expert example, then 30 minutes recalculating the Hedge potential. Simulate two T experts on a small class to distinguish internal and outer updates. Finally derive the two Perceptron inequalities independently, check normalization, and read the supplementary sequential-fat argument.