Project contents

CSCI 678 / Lecture Notes

Lecture 1 Detailed Explanation: Formalizing the Learning Problem and Three Models

A section-by-section expansion of Lecture 1: the formalization of supervised learning, the i.i.d. assumption, the complete proof of the no-free-lunch theorem, the online-to-batch conversion, and the partial-information difficulty of multi-armed bandits.

Active
Expanded from Haipeng Luo's Lecture 1 (Fall 2026, 8 pages of original slides). The structure follows the Lecture 3 explanation report: state the purpose of each problem, explain the quantifiers and notation, prove the formulas step by step, and discuss the examples and the boundaries of each conclusion. Content marked "Supplementary" explains the original text; it does not claim that the slides proved additional theorems. Original slides: lecture1.pdf (not published online). Companion on this site: full slides translation; follow-up explanations: Lecture 2, Lecture 3. Losses and random variables are measurable by default, so that every expectation and difference written here is defined. Arguments on finite spaces need no extra measurability techniques; when generalizing to general spaces, the corresponding conditions should be retained.

Reading guide: why Lecture 1 spends so much space defining the problem

"Learning patterns from data" is not yet a mathematical proposition that can be proved. At minimum one must answer: where the data comes from, what the algorithm can see, when decisions are made, how the loss is computed, who to compare against, and for which environments the guarantee must hold.

This lecture builds three models in turn:

ModelData and informationLearner outputEvaluation criterion
Statistical learningi.i.d. samples from an unknown distributionoutputs one predictor after seeing the training setexpected excess risk relative to the best in class
Full-information online learningdata arrives round by round; the full outcome is seen at the end of each roundmakes one decision first each roundcumulative regret relative to the best fixed decision
Partial-information online learningdata arrives round by round; only the feedback of the chosen action is seendecides and explores each roundcontrolling regret under the feedback restriction

The two core theorems say respectively that "not every class is learnable" and that "online learnability implies statistical learnability". Understanding their quantifiers matters more than memorizing the constants.

1. Supervised learning: from inputs and outputs to loss

1.1 Data, predictor, and learning algorithm are three different objects

The input space is and the output space is . The training set is

The slides abbreviate sequences as . This report treats samples as ordered tuples, allowing repeated points; only when counting "how many distinct inputs have been seen" do we take the set of distinct elements among them.

A predictor is a function . The algorithm is instead a mapping "from training sets to predictors":

A randomized algorithm also depends on an independent random seed , i.e. . is a model; is the procedure that trains a model, and the two must not be conflated.

Cat-versus-dog classification can encode images as with labels encoded as ; machine translation, language modeling, and video summarization can also be written as input-to-output mappings. This is only mathematical modeling; it does not mean these tasks share the same loss or the same computational difficulty.

1.2 What exactly does the loss measure

A general loss is written

The 0–1 loss for binary classification and the squared loss for regression are respectively

The former only distinguishes right from wrong; the latter also penalizes the magnitude of numerical deviation — for example, when the error goes from 1 to 3, the squared loss goes from 1 to 9. The squared loss can be unbounded, so if concentration inequalities or Lipschitz contractions are used later, extra conditions such as boundedness must be added. The choice of loss is part of the problem definition.

2.1 The i.i.d. assumption taken apart

Assume there is an unknown distribution from which both the training samples and new test points are drawn:

"Identically distributed" makes past data consistent with future targets; "independent" guarantees that new points do not carry dependencies deliberately filtered in by the training process. If the training set comes entirely from one environment and the test set from a completely arbitrary different environment, training data alone usually cannot guarantee test performance.

In practice, a random split supports this model only when the original data itself satisfies appropriate sampling conditions. Random splitting by itself does not remove duplicate samples, temporal correlation, or data-source bias. The slides use it to provide intuition, not to claim that any random split automatically proves independence.

2.2 Why risk is better suited to theory than finite test error

Fix an ; the population risk is

The test error on an independent test set is

By linearity of expectation and identical distribution,

Hence the test error is an unbiased estimate of the risk. If the loss variance is , independence also gives

Risk removes the extra random fluctuation brought by a finite test set. If were known, one could in principle minimize directly and the problem would become optimization; statistical learning exists precisely because is unknown and only samples are available.

2.3 Why the risk after training is again a random variable

For fixed , is a number. When random training produces , varies with . Therefore the expected risk of a learning algorithm is

If the test set is independent of the training process, then after conditioning on one still has . If the same test set is used repeatedly to select models, this conditional independence can no longer be invoked directly.

3. Irreducible noise and the goal of "agnostic learning"

3.1 Why nobody can predict fair-coin labels better

Suppose that for every , . An independent new label is conditionally independent of the training set and the algorithm's random seed. Fix : whatever the algorithm predicts,

Taking expectations again, every learning algorithm has risk . Therefore "learning an absolute risk close to zero for arbitrary distributions" is impossible.

But this does not mean the excess risk on this distribution cannot tend to zero: if all reference functions also have risk , every predictor already has zero excess risk. The counterexample here rules out a low-absolute-risk goal with no comparison baseline.

3.2 From assuming distributions to choosing a reference class

The slides use classical parametric statistics as a contrast: for example, assume is a Gaussian vector and, given , is a Gaussian variable with mean , then estimate the parameters. This is an illustrative contrast; it does not mean all of modern statistics studies only parametric Gaussian models.

Agnostic learning chooses a reference class and requires the algorithm to perform nearly as well as the best function in that class:

Here "distribution-free" means that no parametric form is specified for ; the iid assumption, the given loss, and the necessary integrability conditions are still retained. Prior knowledge has not disappeared; it moves into the choice of , such as linear functions, tree models, or some network architecture.

If itself cannot express the task well, being close to its best function does not necessarily mean low absolute risk. Section 8 will express this through an error decomposition.

4. The general statistical learning framework and the quantifiers of learnability

4.1 Generalizing from supervised learning to abstract decisions

Let the sample be , the decision , the reference class , and the loss . Define

When the algorithm always outputs an element of it is called proper; when it is allowed to output decisions outside the class it may be called improper. The slides describe the proper setting with . Strictly speaking, even if is larger, a particular algorithm may still only ever output elements of , and thus remain a proper algorithm.

A proper algorithm has nonnegative excess risk; an improper algorithm can sometimes beat the reference class, making the difference negative, so one cannot default to assuming it is nonnegative in every argument.

4.2 How sample complexity is obtained from a rate

If for all allowed distributions

then to guarantee excess risk at most , solve the inequality:

Here may depend on the dimension of the reference class, the loss range, and so on. Saying does not mean every model needs the same number of samples.

4.3 Pointwise convergence versus distribution-uniform convergence

The following two statements are different:

  • For each fixed , the error is small when is large enough; how large a sample is needed may depend on .
  • There is a sample size independent of that makes the error small for all allowed .

The minimax formulation in this course studies the latter. A finite-sample algorithm may vary with , but cannot depend on the unknown . The no-free-lunch theorem also targets this uniform guarantee.

5. PAC and density estimation: two important examples

5.1 The difference between realizable PAC and agnostic learning

Realizable binary classification assumes there exists such that

Under the 0–1 loss , so

The PAC guarantee is often written as: given error and failure probability , for any input marginal distribution and any target , after enough training samples,

"Probably" corresponds to ; "Approximately Correct" corresponds to the error . The slides write the sample size as , which hides dependencies such as the complexity of the class, and it is not a guarantee on the algorithm's running time.

5.2 How expectation guarantees relate to probability guarantees

For , if (18) holds, then

Conversely, Markov's inequality gives

Hence an expectation of at most suffices to obtain failure probability at most . This is a basic conversion and usually not the tightest sample-size analysis; it must not be mistaken for the two frameworks being exactly equivalent in constants and rates.

5.3 Why density estimation uses the log loss

Now there are no labels; the sample is , the decision is a probability density relative to a common base measure, and the loss is

If the true density is , define

Whenever the relevant integrals and differences are defined, add and subtract :

Why is KL nonnegative? If is zero where , the KL may be . Otherwise use :

so . The auxiliary inequality follows from attaining its minimum value zero at .

Therefore minimizing the expected log loss is equivalent to finding the in-class density closest to the true distribution in the KL sense; it does not require itself to lie in the reference class. A continuous density can be greater than 1, so the log loss itself can be negative; it is not the same as a classification loss that always lies in .

6. The value of the learning game: why the algorithm is chosen first, then the distribution

6.1 The minimax quantity and its quantifiers

The slides define

The outer searches for the best learning rule; the inner checks how this rule performs under the most unfavorable distribution. "Choosing the algorithm first" means committing to a strategy from data to output, not selecting the final predictor before seeing the data.

If it is swapped to , the inner optimal algorithm can be designed for the known , even directly outputting its best in-class decision, essentially bypassing the fact that "the distribution is unknown". In general one only has

and the two cannot be exchanged unconditionally. Proof of (25): for any fixed , ; take the corresponding suprema and infima in turn.

The slides take

as the formal characterization of learnability. Under the usual proper framework with nonnegative excess risk, this is exactly the worst-distribution error tending to zero. If the infimum over strategies is not attained, choose for each a strategy within of the optimal value, and one still obtains a sequence of algorithms tending to zero.

6.2 Which dependencies are hidden by the notation

also depends on and the set of allowed distributions. Giving only the function class while changing the loss or the feedback model may yield different learnability; cannot be treated as the sole determining factor.

7. Theorem 1: the complete lower-bound proof of no free lunch

7.1 The goal is not to find one distribution on which all algorithms fail

For the class of all binary classifiers , prove

The quantifiers are "for every algorithm, there exists a hard distribution", not "there exists one fixed distribution on which all algorithms fail". The algorithm may randomize. The original slides assume is continuous; what is actually needed is that it contains distinct points for every , as any infinite input space does.

7.2 Constructing candidate distributions with finite support

Fix a set of distinct inputs and let be the uniform distribution on them. All binary labelings correspond to functions , where .

For each , define

Every is noiseless and realizable: the reference class contains , so the optimal risk is zero. Letting the proof randomly choose a is only averaging over the candidate distributions; it does not say the labels of each fixed carry coin-flip noise.

7.3 Why a new test point is unseen with probability at least half

Fix a training input sequence and let be the set of distinct inputs in it. It contains at most elements, while has elements, so

This lower bound holds for every training input sequence, with repeated sampling allowed.

7.4 The pairing argument on unseen points: why the algorithm errs at least half the time

Fix an unseen point . Partition the labeling functions into pairs, where each pair differs only on and is identical on the other points.

Because is not in the training set, the two induce the same labeled training set. Hence a deterministic algorithm makes the same prediction on , but the true labels at that point are opposite, giving

A randomized algorithm can use the same random seed in the two cases as a coupling, so the equality still holds seed by seed; then take expectations.

Summing over all pairs and dividing by gives an average error rate of exactly . Therefore, for any algorithm,

An average of finitely many numbers being at least means the risk under at least one is no less than ; it does not mean it must equal exactly . Since the algorithm is arbitrary, taking and then yields (27).

7.5 Supplementary: exact computation of the unseen probability

Fix a test point ; each training point avoids it with probability . Independence gives

So the pairing argument actually gives . The last inequality can also be obtained from Bernoulli's inequality , which can be proved by induction on integers . The slides only need the simpler constant .

7.6 The meaning and scope of this theorem

The hard distribution may vary with the sample size , so the conclusion targets distribution-uniform learnability. It does not say every concrete real task is unlearnable, nor that all fixed distributions are hard. It says: if the class is allowed to vary completely arbitrarily on unseen inputs, there is no universally valid inductive rule.

A class needs some structural constraint for the training data to constrain behavior on unseen points. Lecture 2 will turn this "structural constraint" into a computable parameter via the VC dimension.

8. How approximation, generalization, and optimization errors fit into one equation

Let the optimal risk over the larger comparison space be , and the in-class optimum be . The algebraic identity is

The second term is the approximation error. Enlarging does not increase it, because taking the infimum over a larger set only makes it smaller.

To show how generalization relates to optimization, suppose an approximate ERM outputs satisfying . Define

Choosing the in-class optimum, or any arbitrarily close to it, step by step gives

Hence

The three terms correspond to generalization control, optimization error, and approximation error. This is an upper bound, not an exact decomposition into three independent random errors. Enlarging the class usually makes it more expressive, but the supremum ranges over a larger set, so uniform generalization control may become harder; practical optimization algorithms may also favor some subset of the class. This course mainly studies the statistical generalization part.

9. Online learning: what changes is the decision protocol

9.1 What may be seen in each round

In each round :

  1. The learner chooses based on past information, while the environment simultaneously chooses .
  2. The learner suffers the loss .
  3. In the full-information model, the learner observes the complete before moving to the next round.

Statistical learning delivers a single decision only after seeing the whole training set; online learning makes a sequence of decisions as feedback arrives step by step. The are not required to be independent or identically distributed, nor must any fixed data distribution exist.

In the slides' abstract supervised-learning instance, can be an entire prediction function and is revealed afterwards. If an application sees first and then predicts the label, that is a refined protocol with context; one must state explicitly which information is revealed at which step, and cannot silently change the current definition.

9.2 Why the comparator in regret must be fixed

Define

The opponent is the same fixed chosen in hindsight after seeing all the data. It is not an oracle that may switch to a new best action every round:

The left side allows per-round minimization, hence is smaller, and the task relative to it is harder. The slides study the fixed comparator on the right.

For example, suppose two actions have losses and then over two rounds; both fixed actions accumulate loss 1. If the algorithm happens to pick the first action and then the second, its cumulative loss is zero and the regret is . So regret on a single sequence can be negative.

No-regret learning requires the expected cumulative regret in the worst environment to satisfy

The cumulative regret itself is not required to tend to zero. A cumulative is still no-regret.

10. The power of the environment: oblivious, adaptive, and the current action

10.1 What the two kinds of environments know

An oblivious environment knows the learning algorithm but fixes the entire before the game starts, without changing it based on the actual actions.

An adaptive environment may choose the current based on past actual actions and the public history. But under the simultaneous-move protocol of the slides, it cannot see the currently drawn action before deciding .

One can write the public history as

The environment knows the algorithm, so it can infer the conditional distribution of the current action, but it does not know the outcome of this random draw. Knowing that "the probability of heads" is is completely different information from knowing that this draw came up heads.

10.2 Supplementary: why randomization may be indispensable

Consider predicting a bit, where the loss is a wrong prediction and the reference class consists of the two constant predictors. Against a deterministic algorithm, the environment can infer the current prediction from the public history and the algorithm, and set . The algorithm loses 1 every round, accumulating . The losses of the two constants sum to , so the best constant loses at most , giving

This does not grant the environment the ability to observe the current hidden random action, because the algorithm here is deterministic and its action is already computable from past information.

Randomization makes the actual action impossible to infer exactly, but being "random" alone does not guarantee small regret; the algorithm must still use the history to adjust its distribution. If the environment were allowed to see the current actual random action before flipping the label, (40) would hold for randomized algorithms too — that would change the problem itself.

11. The omitted proof of the nested minimax

11.1 The online value of the game

For a specified environment class , define

Adaptive environments include oblivious ones, so

For adaptive environments the slides write

Each subsequent may depend on the history realized so far. This is not an expression in which all distributions are chosen once at the start.

11.2 A complete backward-induction proof for finite spaces

First assume are finite, the loss is finite, and the number of rounds is finite, to avoid measurable strategy-selection issues. The terminal payoff is

Define recursively

Why does the last round look like this? Given the history, the learner chooses a randomization distribution , the environment may choose based on , and then the action is drawn. The conditional expectation is exactly the sum on the right. The algorithm wants the expectation under the worst to be as small as possible, hence the outer .

The induction hypothesis is that already equals the value of the game at every subsequent history. We now show separately that is an attainable upper bound and an unbreakable lower bound.

Upper bound: At every history the learner chooses a that attains, or is -close to, the infimum in (45), and continues with the corresponding approximately optimal strategy at every later history. Whatever the environment does, the current expectation is at most , and the accumulated approximation error afterwards is at most the number of remaining rounds times . So the worst payoff of the optimal strategy does not exceed .

Lower bound: Take any learner strategy; it induces some conditional distribution at the current history. The environment chooses a that brings the right side as close to the supremum as possible. After the action is realized, it continues at the next history with the approximately worst-case response guaranteed by induction. Hence the worst payoff of this strategy is at least .

Let ; the two sides coincide, completing the induction. Unrolling (45) from then yields (43).

Extra randomization by the environment over the current cannot raise the supremum at this step, because what randomization yields is only a weighted average of the payoffs of fixed 's, which does not exceed the maximum.

11.3 Why pre-randomizing the algorithm and per-round sampling can be equivalent

The slides describe a randomized strategy as "a distribution over a set of deterministic history mappings". On a finite history tree, one can draw an action for every possible history in advance at the start, forming a complete deterministic strategy; when a history is actually reached, reading off the corresponding action implements the given per-round randomized strategy.

Conversely, for any complete strategy randomized in advance, taking the conditional distribution of the current action given the realized public history yields . Sampling round by round according to these conditional distributions produces the same path distribution by the multiplication rule of conditional probabilities. Here the learner remembers its own past actions and information, i.e. it has perfect recall.

So one cannot treat all rounds as mutually unrelated fixed mixed actions; the history-dependent conditional distributions are the key.

For general infinite spaces, this recursion remains the standard intuition and formal statement, but a fully rigorous generalization of the equalities requires corresponding measurability, conditional-distribution, and approximate strategy-selection conditions. The technical proofs the slides omit for arbitrary abstract spaces cannot be declared fully settled on the strength of the finite case alone. This report gives the complete proof of the finite case and marks the conditions for generalization.

12. Theorem 2: the online-to-batch conversion

12.1 How the conversion algorithm runs

Given an iid training set and any online algorithm:

  1. Feed the samples to the algorithm in order as online feedback.
  2. The -th online decision must be produced before reading .
  3. Draw independently and uniformly, and output .

Randomly choosing a past decision keeps the output space unchanged, so it is legitimate even without linear or convex structure.

12.2 The most important independence equality

Let contain the previous samples and the algorithmic randomness needed to produce . Because is a fresh iid point, independent of this information,

Taking expectations again: . If the algorithm looked at before producing , this equality would generally fail — this is exactly why the conversion requires this temporal order.

12.3 Each step of the inequality

For any fixed , by the uniform random output and (46):

The third step holds because the empirical best comparator's loss is no larger than any fixed 's empirical loss, and subtracting a smaller number makes the difference larger.

Taking on the left side, with the right side unchanged, gives

Note that we did not incorrectly interchange with . The proof fixes first and takes the supremum only at the end, precisely to avoid this problem.

12.4 From a single algorithm to the value of the game

If an online algorithm has expected average regret at most on all fixed sequences, then averaging over randomly generated iid sequences also keeps it at most . So the batch algorithm obtained from its conversion has excess risk at most for all .

Taking the infimum over online algorithms yields

If the online cumulative regret is , the batch excess risk is . Hence online learnability implies statistical learnability; the converse does not follow from this. The slides announce that later lectures will give examples where the inequality is strict; this lecture does not prove the specific properties of those examples.

12.5 Supplementary: when can one average the models

If is convex and is convex in , then , and Jensen's inequality gives

In this case the averaged decision can replace randomly picking one decision. General discrete predictors or nonconvex decision spaces have no such guarantee; the slides choose the random output precisely so that no extra convexity assumptions are needed.

13. Partial information: what makes multi-armed bandits hard

13.1 Writing the problem in the slides' abstract notation

Suppose there are actions,

Each round the environment sets a loss vector , the algorithm chooses , and only observes

Regret is still relative to the best fixed action:

The full-information model sees the complete vector, so it can compute every action's loss that round; the bandit model sees only the one coordinate of the chosen action. A recommender system sees whether the user clicked the recommended item, but not the counterfactual feedback for items not recommended — an intuitive example of this model.

13.2 An indistinguishability example

Suppose the algorithm always chooses action 1 and always observes loss . It cannot distinguish the environment "action 2's loss is always 0" from the environment "action 2's loss is always 1", because the actual feedback is identical.

In the first environment, always choosing action 1 incurs linear regret . This shows that exploring other actions is not a decorative trick but a necessity for obtaining the information that distinguishes environments.

13.3 Supplementary: a feedback-estimation formula explaining the role of exploration

If the current action is drawn according to with all , one can define

Conditioned on past information and the already-chosen current , the current action is only then sampled, so

But its second moment is

Very small sampling probabilities amplify estimation fluctuation, and zero probability makes that coordinate impossible to estimate at all. This explains the tension between exploration and exploitation. It is only a supplementary derivation to help understand the feedback, not a complete no-regret bandit algorithm proof.

13.4 Why the full-information nested formula cannot be copied directly

In the full-information model, two different 's are both observed by the learner, and later strategies can choose actions separately for them. In the bandit model, as long as they produce the same , the learner cannot distinguish them and must adopt the same conditional strategy at those histories.

If one still placed an independent after every complete hidden history, one would be tacitly allowing the learner to see unrevealed coordinates, thereby underestimating the difficulty of the game. A correct formalization must keep the information constraint "same observed history implies same strategy", or introduce extra structure such as belief states.

So when the slides say there is no obvious nested expression of the same kind, it does not mean partial-information games cannot be formalized at all, but that the simple backward induction of the full-information case cannot be used unmodified.

14. Overall connections, boundary conditions, and the slides index

14.1 How the three levels of difficulty accumulate

Statistical learning faces an unknown distribution, but the iid structure provides the link between past and future. Online learning removes the fixed-distribution assumption and requires a decision each round before the feedback. Partial information further restricts the feedback, so the algorithm must not only choose low-loss actions but also acquire enough information.

This lecture does not prove concrete optimal rates under the three frameworks; it establishes the evaluation criteria and two basic logical conclusions:

Lecture 2 starts from and finds complexity measures that can control it; Lecture 3 then further handles real-valued infinite classes.

14.2 The most easily misread points

Slide wording or shorthandRigorous reading
Risk is a fixed quantityTrue for a fixed predictor; the risk of a randomly trained predictor varies with the training set
Distribution-freeNo parametric form is specified for ; modeling conditions such as iid remain
Fair labels mean "unlearnable"Absolute risk cannot be pushed below ; relative to a reference class equally limited by noise, excess risk can be zero
means improperThe space allows out-of-class outputs; whether a concrete algorithm is proper depends on whether its actual outputs always stay in the class
No Free Lunch assumes a continuous input spaceThe lower bound only needs sufficiently many distinct inputs, and targets distribution-uniform guarantees
Average risk at least There exists a distribution with risk no less than ; not necessarily equal
No-regret means "regret tends to zero"The correct requirement is that average regret tends to zero, i.e. cumulative regret is sublinear
Adaptive environments are very strongThey may depend on past actual actions, but in this protocol cannot respond after seeing the current random action
The nested-game formula for general spacesFinite spaces admit complete backward induction; general spaces need measurability and strategy-selection conditions added
Online-to-batch can average any modelsRandomly picking one always stays legitimate; direct averaging needs conditions like a convex space and convex loss
Partial information just sees fewer numbersIt also restricts which later strategies may depend on which histories

14.3 Locating each proof

Original slides contentThis report
Inputs, outputs, predictors, lossSection 1, (1)–(4)
iid, test error, risk and its randomnessSection 2, (5)–(10)
Fair-coin counterexample, agnostic-learning motivationSection 3, (11)–(12)
General setup, excess risk, sample sizeSection 4, (13)–(15)
PAC exampleSections 5.1–5.2, (16)–(20)
Density estimation and the KL identitySection 5.3, (21)–(23)
Statistical value of the game and learnabilitySection 6, (24)–(26)
Theorem 1: No Free LunchSection 7, (27)–(32)
Approximation, generalization, and optimization errorsSection 8, (33)–(35)
Online protocol, regret, environment classesSections 9–10, (36)–(40)
Slides equations (2), (3): nested game valueSection 11, (41)–(45)
Theorem 2: online-to-batchSection 12, (46)–(50)
Partial information and MABSection 13, (51)–(56)

14.4 Questions you should be able to answer independently afterwards

  1. Why must the risk of a training algorithm be expected over the randomness of the training set?
  2. Why should the learning goal compare against the best function in a reference class, rather than demanding absolute risk tending to zero for all distributions?
  3. In the no-free-lunch proof, what is the difference between randomly choosing the labeling function and the data distribution itself having random labels?
  4. Why is online regret different from "the best action each round"?
  5. In the nested expression, why does come before the expectation over the current action draw?
  6. At which step does the online-to-batch proof rely on not reading ?
  7. Why can't a bandit allow the strategy to depend on the complete hidden loss vector?

Reviewed against revision lecture1-explanation-report@2026-09-14