Concepts / PAC Learning

PAC Learning

Realizability demands perfect agreement between some hypothesis in H and a target labeling function.

  • Programming

When Perfect Labels Fail

A traditional learning model often assumes that the features of every input determine one correct label with complete certainty. Under this assumption, there is a target labeling function, and some hypothesis in the class H agrees perfectly with that function. This is the realizability assumption. It makes learning conceptually clean: the learner searches for a hypothesis that makes no errors on the underlying labeling rule. Practical data, however, may not satisfy this assumption. Measured features may fail to capture everything that influences a label, so the same feature description can be associated with different labels. Agnostic PAC learning removes the requirement that one hypothesis represent the data perfectly.

perfect agreementclose to best in HRealizable datah in H agrees perfectlyTarget labelingfunctionone correct labelAgnostic datano perfect h in HOptimal hypothesisbest performance in H
What changes when a perfectly correct hypothesis exists in H versus when every hypothesis makes some errors?

A Joint View of Data and Labels

Agnostic PAC learning describes data generation with a joint data-labels distribution over X × Y. Here, X represents the domain of possible feature descriptions and Y represents the possible labels. A joint distribution assigns likelihood to combinations of a domain point and a label. It therefore describes the two parts together: which point appears and which label accompanies that point.

Papaya features and taste labels

Separate the questions answered by a distribution over papaya feature descriptions and taste labels.

Start with a feature description: Treat a papaya's measured features as a domain point x in X.

Pair the point with a label: A joint outcome is a pair consisting of that feature description and a taste label. The distribution describes how likely that pair is.

Allow repeated feature descriptions: The same feature description can occur with different labels in an agnostic model. The data-labels distribution records the probabilities of the different pairs rather than requiring one label to be correct with complete certainty.

Separate occurrence from labeling: The probability that the feature description appears is a marginal question. The probability of each taste label after that feature description is known is a conditional question.

The joint distribution gives one model for both which feature descriptions occur and how labels are associated with them.

paired withpaired withcontainscontainsFeature point xsame domain description(x, y1)joint outcomey1conditional possibility(x, y2)joint outcomey2conditional possibility
How can the same domain point x appear with different labels, and how are those possibilities represented in the joint distribution?

The diagram does not say that a single observation simultaneously has two labels. It shows that the same domain description can participate in different possible domain-label outcomes under the data-generating distribution. This is precisely what the realizability assumption rules out when it requires one correct label for each input description.

Marginal and Conditional Questions

ViewQuestion it answersWhat it describes
Marginal distributionWhich domain points are likely to appear?The distribution over domain points after labels are not the focus
Conditional probabilityGiven a particular domain point, how likely is each label?The label possibilities associated with that point
Joint distributionHow likely is a domain point-label pair?The data point and its label together
describesdescribespart ofpart ofMarginaldistributiondomain pointsWhich x occurslikelihood of pointsJoint distributionx and y togetherConditionalprobabilitylabels given xWhich y given xlabel likelihoods
What does the marginal distribution tell us about which points occur, and what does the conditional probability tell us about labels given a point?

Suppose the domain point is a papaya feature description. The marginal distribution asks how likely that feature description is to appear at all. It does not, by itself, answer which taste label accompanies the point. The conditional probability asks the second question: once the feature description is fixed, how likely is each label? Keeping these questions separate prevents a common misunderstanding. A point can be common or rare independently of whether its labels are concentrated or varied.

ERM and the Agnostic Goal

In agnostic PAC learning, the learner does not assume that the data can be represented perfectly by a hypothesis in H. The target therefore changes. Instead of requiring zero error, the learner seeks a hypothesis whose performance is close to that of the optimal hypothesis in H. This comparison is important: the learner is judged against the best available member of the chosen hypothesis class, not against a perfect hypothesis that may not exist.

measurecompareselectLabeled sampleobserved dataEmpirical risksone value per h in HERMminimize empirical riskChosen hypothesislearner output
How does ERM move from a labeled sample to the hypothesis with the smallest empirical risk, and how does that produce a learner?

Why ERM needs a theorem

Explain why selecting the hypothesis with the smallest empirical risk is not, by itself, enough to establish agnostic PAC learning.

Observe the sample: The learner receives a finite labeled sample from the joint data-labels distribution.

Compute empirical risk: ERM evaluates how each hypothesis performs on the observed sample and chooses a hypothesis with the smallest empirical risk.

Connect sample performance to distribution performance: The desired agnostic guarantee concerns true risk, not only performance on the observed sample. A theorem is needed to relate empirical risk to true risk.

Compare with the class optimum: Once the empirical and true risks are controlled together, the ERM output can be shown to perform close to the optimal hypothesis in H.

ERM supplies the selection procedure; the risk-comparison argument supplies the learning guarantee.

Uniform Risk Control

Theorem 26.5 provides a uniform risk comparison for every hypothesis in the class. Its role is to control the difference between true risk and empirical risk, not merely for the hypothesis eventually selected by ERM, but for all hypotheses in H at once. This uniform statement is what allows the proof to analyze the data-dependent choice made by ERM. Without such a connection, a hypothesis could look best on the observed sample without the analysis establishing that it is close to the best choice under the underlying distribution.

definecombinecontrol total failurePer-hypothesisboundsrisk deviationsFailure eventsone for each hUnion boundcombine probabilitiesUniform riskcomparisonall h in H
How do per-hypothesis deviation bounds combine through the union bound to ensure that empirical risks are close to true risks for all hypotheses at once?

The proof considers the possibility that a hypothesis has a substantial difference between its true risk and empirical risk. Theorem 26.5 supplies the relevant comparison for each hypothesis. The union bound then controls the probability that any of the relevant failure events occurs. The result is a statement that the comparison holds simultaneously across the hypothesis class, with a controlled probability of failure.

  • Treating the theorem as a guarantee only for the ERM output.

    The chosen hypothesis depends on the sample. A guarantee stated uniformly for every hypothesis is what allows the proof to cover the data-dependent ERM choice.

    Fix: Understand Theorem 26.5 as a simultaneous comparison across H before focusing on the hypothesis selected by ERM.

  • Assuming the union bound makes every individual failure event impossible.

    The union bound controls the probability of the combined event; it does not assert that every component event is impossible.

    Fix: Use it to bound the probability that at least one relevant comparison fails.

  • Confusing empirical risk with true risk.

    Empirical risk is based on the sample, while the agnostic objective concerns performance under the data-generating distribution.

    Fix: Use the uniform risk comparison to connect the two quantities.

Why Sample Size Matters

An upper-bound proof for agnostic PAC learnability establishes that there is a sufficient sample complexity for achieving the desired comparison with the optimal hypothesis in H. The sample-size condition is needed because the proof must make the final error small enough, typically below a chosen epsilon. The source material does not provide the literal algebraic expression for that sample complexity. The justified structural conclusion is that the proof first obtains a uniform risk bound, combines the relevant failure events with the union bound, and then imposes the sufficient condition from Lemma A.2 so the final error is below epsilon.

may leavesatisfies conditionSmall samplecondition not establishedRisk comparisonnot controlled enoughSufficient sampleLemma A.2 conditionPAC guaranteefinal error below epsilon
How does increasing the sample size reduce estimation uncertainty enough to guarantee the desired PAC bound?

Practice: Trace the Proof

What do you think happens?

A learner uses ERM and selects the hypothesis with the smallest empirical risk. What additional argument is needed before calling this an agnostic PAC learner?

  • A claim that the selected hypothesis is perfectly correct
  • A comparison connecting empirical risk with true risk for the hypotheses under consideration
  • A claim that every domain point has only one possible label
  • A replacement of the joint distribution by a target labeling function
Reveal answer

Answer: A comparison connecting empirical risk with true risk for the hypotheses under consideration

ERM minimizes empirical risk, but agnostic learning evaluates performance relative to the data-generating distribution. Theorem 26.5 supplies a uniform risk comparison, and the union bound controls the combined probability of failure.

EASY

A feature description x can be associated with labels y1 and y2 under a data-labels distribution. Identify which question belongs to the marginal distribution and which belongs to the conditional probability: how often x appears, and how likely y1 is once x is given.

Hints
  • The marginal view focuses on domain points.
  • The conditional view focuses on labels after a particular point is fixed.
MEDIUM

Put these proof moves in order: impose a sufficient sample-size condition, apply ERM to empirical risks, obtain a uniform true-versus-empirical risk comparison, and use the union bound to control the combined failure probability.

Hints
  • ERM is the learner's selection procedure.
  • The union bound combines failure events.
  • The sufficient condition is used for the final error target.

Key Takeaways

  1. Realizability requires some hypothesis in H to agree perfectly with a target labeling function, an assumption that may fail when measured features do not completely determine labels.
  2. Agnostic PAC learning uses a joint distribution over domain points and labels, allowing the same domain point to be associated with different possible labels.
  3. The marginal distribution describes which domain points occur, while the conditional probability describes labels given a particular point.
  4. ERM selects a hypothesis with the smallest empirical risk, but Theorem 26.5 is needed to connect empirical risk with true risk uniformly across H.
  5. The union bound controls combined failure events, and a sufficient sample-size condition ensures that the final error is below epsilon.

Key Takeaways

  • Realizability demands perfect agreement between a hypothesis in H and a target labeling function; agnostic learning does not make that demand.
  • A joint data-labels distribution describes domain points and labels together and can assign different label possibilities to the same domain point.
  • The marginal distribution concerns which points occur, while conditional probabilities concern labels given a point.
  • ERM provides the selection rule, while Theorem 26.5, the union bound, and a sufficient sample-size condition provide the agnostic PAC guarantee.