PAC learning, short for probably approximately correct learning, is a mathematical framework in machine learning that defines when a class of concepts can be learned from examples: a learner must, with probability at least 1 − δ, output a hypothesis whose error is at most ε, using a number of samples and an amount of computation that grow only polynomially. Introduced by Leslie Valiant in 1984, it is a cornerstone of computational learning theory within artificial intelligence.
The framework turns the vague question of whether a model will generalize into a precise one about sample complexity and computational complexity. It explains why richer hypothesis spaces need more data, links learnability to the VC dimension, and supplies the theoretical foundation for methods such as boosting and regularized empirical risk minimization.
How the PAC model formalizes learning
The PAC model describes learning as a game between a learner and an unknown data distribution. Examples are drawn independently and identically distributed (i.i.d.) from a distribution D over an instance space X, and each example is labeled by an unknown target concept c taken from a known concept class C. The learner sees m labeled examples and must return a hypothesis h from a hypothesis class H.
The quality of h is measured by its true error, the probability that h and c disagree on a fresh example drawn from the same distribution D. The two famous qualifiers map directly onto two parameters: approximately correct means the true error is at most ε, and probably means this outcome occurs with probability at least 1 − δ over the random draw of the training sample.
A concept class is PAC learnable if one algorithm achieves this guarantee for every distribution D, every target concept in C, and every choice of ε and δ in the open interval from 0 to 1. The definition is distribution-free: the learner does not know D, yet the same sample bound must hold for all of them. The table below summarizes the components of the model.
| Component | Symbol | Role in the model |
|---|---|---|
| Instance space | X | All possible inputs, such as feature vectors |
| Data distribution | D | Unknown source of i.i.d. examples |
| Concept class | C | Set of possible true labeling functions |
| Hypothesis class | H | Set of functions the learner may output |
| Accuracy parameter | ε | Maximum tolerated true error |
| Confidence parameter | δ | Maximum tolerated failure probability |
| Sample size | m | Number of labeled training examples |
Sample complexity bounds in PAC learning
Sample complexity is the smallest number of examples that guarantees the (ε, δ) requirement. For a finite hypothesis class in the realizable setting, where some hypothesis in H is perfectly consistent with the target, any learner that outputs a consistent hypothesis succeeds once m ≥ (1/ε)(ln|H| + ln(1/δ)). The bound grows only logarithmically in the size of H and in 1/δ, but linearly in 1/ε.
In the agnostic setting, no hypothesis is assumed to be perfect, and the goal becomes reaching an error within ε of the best hypothesis in H. Hoeffding’s inequality and a union bound then give m ≥ (1/(2ε²))(ln|H| + ln(2/δ)), so the dependence on accuracy becomes quadratic in 1/ε. For infinite classes, the logarithm of |H| is replaced by the VC dimension d, which measures the largest set of points the class can label in every possible way.
| Setting | Order of sample complexity | Key dependence |
|---|---|---|
| Finite H, realizable | (ln|H| + ln(1/δ)) / ε | Logarithmic in class size |
| Finite H, agnostic | (ln|H| + ln(1/δ)) / ε² | Quadratic in accuracy |
| VC dimension d, realizable | (d + ln(1/δ)) / ε | Linear in capacity |
| VC dimension d, agnostic | (d + ln(1/δ)) / ε² | Capacity and accuracy |
The fundamental theorem of statistical learning states that, for binary classification, a hypothesis class is PAC learnable if and only if its VC dimension is finite. Empirical risk minimization is then a valid learner, and the realizable and agnostic rates differ by the familiar factor of 1/ε.
Efficient learnability and computational limits
Valiant’s original definition also demands computational efficiency: the learner must run in time polynomial in 1/ε, 1/δ, the input dimension and the size of the target concept. A class can therefore be learnable from a statistical point of view yet hard to learn in practice, because finding a consistent hypothesis may be an NP-hard optimization problem.
The distinction between proper and improper learning matters here. A proper learner must output a hypothesis from C itself, while an improper learner may use a richer class. The classic case is 3-term DNF formulas: learning them properly is hard unless RP equals NP, yet they are efficiently learnable when the output is allowed to be a 3-CNF formula. The table contrasts several well-known results.
| Concept class | Efficiently PAC learnable | Comment |
|---|---|---|
| Boolean conjunctions | Yes | Simple elimination algorithm |
| Axis-aligned rectangles | Yes | Tightest fitting box is consistent |
| Linear halfspaces, realizable | Yes | Solved by linear programming |
| 3-term DNF, proper | No, unless RP = NP | Learnable improperly as 3-CNF |
| Small Boolean circuits | Believed not | Hardness under cryptographic assumptions |
A landmark result connects PAC learning to ensemble methods. Robert Schapire proved that weak learnability equals strong learnability: any algorithm that beats random guessing by a fixed margin can be boosted into one with arbitrarily small error. This insight led directly to AdaBoost and the wider family of boosting algorithms.
PAC learning compared with related frameworks
PAC learning is one of several theoretical lenses on generalization, and each one changes a different assumption. The most common alternatives relax the i.i.d. assumption, replace worst-case guarantees with prior beliefs, or measure capacity in a data-dependent way. The comparison below shows where the PAC model sits.
| Framework | Main assumption | Typical guarantee |
|---|---|---|
| PAC learning | i.i.d. data, unknown distribution | Error at most ε with probability 1 − δ |
| Online learning | Adversarial sequence of examples | Bounded mistakes or regret |
| PAC-Bayes | Prior over hypotheses | Bound depends on posterior divergence |
| Rademacher complexity | i.i.d. data | Data-dependent generalization bound |
| Bayesian learning | Prior over concepts | Posterior-averaged prediction |
In practice these frameworks complement one another. Rademacher and PAC-Bayes bounds are often tighter for specific datasets, while online learning addresses settings with concept drift, where the distribution itself changes over time.
Limitations and common misconceptions
PAC guarantees are worst-case over distributions, which makes them robust but often very loose. Practical models routinely generalize with far fewer samples than the bounds require, because real data distributions are far more benign than the adversarial cases the theory covers. The main caveats are listed below.
- PAC bounds are not sample-size recipes: they give sufficient conditions, and actual needs are usually much lower.
- The i.i.d. assumption is essential: data leakage, distribution shift or temporal dependence invalidate the guarantee.
- Classical bounds struggle with deep networks: overparameterized models with huge VC dimension still generalize, which the basic theory does not explain.
- Statistical learnability is not efficiency: a finite VC dimension says nothing about whether training is tractable.
- ε and δ are distinct: confidence concerns the training sample, accuracy concerns future predictions.
A plain-language summary
PAC learning asks a simple question. How many examples does a computer need before it can be trusted to learn a rule? The answer has two parts. The rule should be almost right, and this should happen almost always.
Think of a student who studies sample exam questions. The student cannot be perfect, and a strange set of practice questions could mislead anyone. PAC learning promises that, with enough practice questions, the student will make only a few mistakes on the real exam. It also says the promise will hold in nearly every case. A more flexible student who can memorize more patterns needs more practice to avoid fooling themselves.
An example from practice
A data science team builds a transparent filter that flags suspicious transactions using a conjunction of Boolean rules over 50 binary features, such as an unusual country or a first-time merchant. Each feature can appear as true, appear as false, or be ignored, so the hypothesis class contains 3 to the power of 50 rules, and ln|H| is about 55.
The team requires an error of at most 5 percent (ε = 0.05) with 99 percent confidence (δ = 0.01). Applying the realizable bound, m ≥ 20 × (55 + 4.6), which gives roughly 1,200 labeled transactions. The team labels 1,500 historical transactions to keep a margin and trains a consistent conjunction.
On a held-out set of 2,000 later transactions, the filter reaches an error of about 3 percent, comfortably inside the guarantee. The team also learns the main caveat: when fraud patterns shift months later, the i.i.d. assumption breaks, and the filter must be retrained on fresh data.