Active Learning
Choosing which labels to pay for, and how many you need.
Labels are often the expensive part of machine learning: a radiologist's reading, a lab assay, a lawyer's review. An active learner chooses which examples to send to the labeler. On some problems that cuts the labels needed from order to order ; on others no strategy beats random sampling, and a careless one converges to the wrong answer. This lesson develops the theory that tells the cases apart.
What you’ll learn
- Distinguish query synthesis, stream-based selective sampling and pool-based active learning, and define label complexity.
- Prove the exponential label savings of binary search for thresholds, and give Dasgupta's example where some targets need order labels whatever the strategy.
- Define the disagreement coefficient, sketch why disagreement-based learning needs about labels, and state the agnostic lower bound .
- Explain why uncertainty sampling can be inconsistent, and prove that importance weighting gives unbiased risk estimates from actively chosen labels.
Settings, costs and the classic heuristics
In active learning unlabeled inputs are cheap and each label has a price. The label complexity of a strategy is the number of label requests it needs to output, with probability at least , a hypothesis with error at most (realizable case) or at most , where (agnostic case). Three settings differ in what the learner may ask:
- Membership-query synthesis (Angluin, 1988): the learner constructs any input and asks for its label. Powerful in theory, but synthesized inputs need not be meaningful: when Lang & Baum (1992) used membership queries with human labelers to learn handwritten characters, many of the synthesized images were unrecognizable hybrids that no one could label meaningfully.
- Stream-based selective sampling (Cohn, Atlas & Ladner, 1994): inputs arrive one at a time from , and the learner decides on the spot whether to buy each label.
- Pool-based learning: a large pool of unlabeled inputs, from which the learner repeatedly picks the next one to label. This is the most common setting in practice.
POOL-BASED UNCERTAINTY SAMPLING(pool U, budget B, initial labeled set L)
repeat B times:
fit a probabilistic classifier p(y | x) on L
x* = the point of U whose prediction is least certain:
max over classes of p(y | x) smallest (least confidence)
or entropy of p(. | x) largest (maximum entropy)
ask the labeler for y*; move (x*, y*) from U to L
return the classifier fitted on LUncertainty sampling (Lewis & Gale, 1994) in its usual pool-based form. Query by committee (Seung, Opper & Sompolinsky, 1992) instead trains several hypotheses consistent with the labels so far and queries where they disagree most; MacKay (1992) derived information-based criteria that score a candidate by how much its label is expected to tell about the parameters.
Binary search, and a problem no strategy can speed up
Let be the true threshold. Any threshold consistent with labeled points sits between the largest negative and the smallest positive one, so its error is at most unless one of the two intervals of mass adjoining received no point. Each is empty with probability :
Sorted by , the hidden labels of the pool read , so the switch lies in one of gaps. Each query at the middle of the remaining candidates halves them:
Binary search reveals the labels of the entire pool by monotonicity, so its output is a threshold consistent with all points, exactly what a passive learner would have produced after paying for all labels. Step 1 applies to it unchanged.
With and , the pool has points. How many labels does binary search request?
Show the answer
12 labels
, since . A passive learner with the same guarantee from this argument pays for all 3,689 labels, about 300 times more. Doubling the precision (halving ) costs the passive learner 3,689 more labels and the active learner one.
So label complexity depends on the target and on , not only on the class. Dasgupta captured this with a splitting index , which measures how well single queries can cut down the remaining candidates near the target: every strategy needs labels, and a generic one needs at most , with the VC dimension of the class. For homogeneous linear separators (through the origin) with the uniform distribution on the sphere, is a constant, so labels suffice, polylogarithmic in ; query by committee achieves a bound of this form there when the target is drawn from a uniform prior (Freund, Seung, Shamir & Tishby, 1997).
Disagreement-based learning and its label complexity
The CAL algorithm of Cohn, Atlas & Ladner (1994) is the simplest strategy with a general guarantee. In the realizable stream setting it keeps the version space , the hypotheses consistent with every label seen so far, and queries a point only when disagrees about it, that is, when the point lies in the region of disagreement . Outside it, every consistent hypothesis gives the same label, so the label can be inferred for free and is never wrong.
| Class and distribution | Disagreement coefficient | Why |
|---|---|---|
| Thresholds on , any continuous | moves the threshold by mass at most to either side, so the disputed region has mass at most | |
| Intervals on , target interval of mass | for just above the ball contains intervals anywhere, so every input is disputed (Dasgupta, 2011) | |
| Homogeneous linear separators, uniform on the sphere in | the disputed region is a band around the target's boundary whose width scales like and whose mass scales like times it |
CAL's labels, queried or inferred, are all correct, so after stream points its version space holds exactly the hypotheses consistent with i.i.d. labeled examples. By the realizable uniform-convergence bound for a class of VC dimension , with high probability all of them have error at most
Point is queried only if it falls in , an event of probability at most by the definition of :
Sum over the stream. Reaching error takes about stream points, and :
Dasgupta, Hsu & Monteleoni (2007) extended the scheme to the agnostic case, replacing "consistent" by a statistical test on the labels bought so far, and proved bounds of the same form, with an additional term for noise:
The term cannot be removed. Kääriäinen (2006) showed that when the best achievable error is , some problems need labels whatever the strategy, so with noise the exponential savings of the realizable case disappear; the first agnostic algorithm with logarithmic label complexity in favorable cases was the A² algorithm of Balcan, Beygelzimer & Langford (2006), whose label complexity Hanneke bounded through . Hanneke (2014) surveys the theory.
For thresholds on the line under a continuous distribution, . Under the sketch above, what happens to the number of labels CAL needs when you shrink the target error from to ?
- It is multiplied by about 1,000, as for passive learning
- It grows only polylogarithmically: becomes
- It does not change at all, because is constant
- It is multiplied by , because labels scale like
Show the answer
B. It grows only polylogarithmically: becomes
With bounded, the label count is , so a 1,000-fold gain in precision only adds to the logarithm inside the square. The number of unlabeled stream points still grows like ; what shrinks is the fraction of them worth paying for.
Sampling bias, and how to correct it
Heuristics like uncertainty sampling query where the current model is unsure. The labeled set they build is anything but a random sample of , and the model trained on it can be confidently wrong about regions it never looked at.
Disagreement-based methods avoid the trap by construction: they skip a point only when its label is implied by every candidate still in play, so nothing is assumed about unexplored regions. A second remedy keeps the bias visible and corrects it. Importance-weighted active learning (Beygelzimer, Dasgupta & Langford, 2009) queries each streaming point with a probability , large where the plausible hypotheses disagree and small where they agree, and weights each queried example by .
Let indicate that the label of was bought, with . Define the weighted loss of any fixed hypothesis :
Conditioning on the past and on the current example, the indicator averages to and cancels the weight:
Taking expectations, for every , however adaptively was chosen. The deviations form a martingale, so concentration holds as long as the weights are not huge; IWAL keeps bounded away from zero wherever the candidates disagree, which yields both consistency and label-complexity bounds in terms of .
Dasgupta (2011) calls this one of the "two faces" of active learning: shrinking the space of candidate classifiers as fast as possible. The other face exploits cluster structure in the unlabeled pool: if the data form nearly pure clusters, a few labels per cluster can label everything, which connects active learning to the assumptions of Semi-Supervised Learning.
Key takeaways
- Active learning minimizes label complexity, the number of labels needed for error (or ) with confidence ; query synthesis, stream and pool settings differ in what may be asked.
- For thresholds, binary search over a pool of points needs labels against passively. In the plane, some targets need order labels whatever the strategy: savings depend on the target and the distribution.
- CAL queries only in the region of disagreement. With disagreement coefficient ( for thresholds, for homogeneous separators under the uniform distribution), disagreement-based methods need about labels, plus with noise rate ; is unavoidable.
- Adaptive querying creates sampling bias: uncertainty sampling can converge to 5% error when 2.5% is achievable. Importance weights make risk estimates unbiased for every hypothesis, however the query probabilities were chosen.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In the realizable case, what does CAL do with a streaming point that lies outside the region of disagreement of its version space?
- It queries the label anyway, to be safe
- It discards the point without using it
- It infers the label that every consistent hypothesis assigns, which cannot be wrong
- It labels the point with probability each way
Show the answer
C. It infers the label that every consistent hypothesis assigns, which cannot be wrong
Outside all consistent hypotheses agree, and the target is one of them, so their common label is correct. CAL pays only for points inside , whose mass shrinks as the version space does; the disagreement coefficient measures how fast.
For linear separators in the plane with data on a circle, why do some targets need on the order of labels even for an active learner?
- The VC dimension of planar separators is infinite
- Active learners cannot use binary search in two dimensions
- The data on a circle are not linearly separable
- The all-positive target and targets that are negative only on disjoint small arcs agree everywhere outside those arcs, so each arc must be probed to rule it out
Show the answer
D. The all-positive target and targets that are negative only on disjoint small arcs agree everywhere outside those arcs, so each arc must be probed to rule it out
A query outside arc cannot distinguish from . With disjoint arcs, identifying the target needs queries inside about half of them, whatever the order. Balanced targets do allow labels, so the label complexity depends on the target, which the splitting index and disagreement coefficient quantify.
The best classifier in your class has error , and you want excess error . What does the agnostic lower bound say about the labels any active strategy may need in the worst case?
- About labels suffice, as for thresholds
- On the order of labels, so exponential savings are impossible
- About labels, since the noise rate is all that must be estimated
- No bound applies, since active learners choose their data
Show the answer
B. On the order of labels, so exponential savings are impossible
Kääriäinen (2006) showed that with noise rate some problems need labels. With noise, error rates must be estimated to precision , and choosing where to look cannot replace the repeated samples that estimation needs.
Why can uncertainty sampling converge to a suboptimal classifier even with unlimited labels?
- Its queries concentrate near the current boundary, so regions the first random sample missed are never examined, and the model stays confidently wrong there
- It overfits because it uses too many labels
- It needs a probabilistic model, and probabilities are always miscalibrated
- It cannot: with unlimited labels every strategy is consistent
Show the answer
A. Its queries concentrate near the current boundary, so regions the first random sample missed are never examined, and the model stays confidently wrong there
In Dasgupta's four-group example, the learner never queries the overlooked 5% group, converges to 5% error, and misses the 2.5% optimum. Disagreement-based querying, or importance weighting with query probabilities bounded away from zero, restores consistency.
Further reading
- B. Settles, Active Learning (Synthesis Lectures on Artificial Intelligence and Machine Learning, Morgan & Claypool, 2012).
- D. Cohn, L. Atlas & R. Ladner, "Improving generalization with active learning," Machine Learning 15, 201–221 (1994).
- S. Dasgupta, "Two faces of active learning," Theoretical Computer Science 412, 1767–1781 (2011).
- S. Dasgupta, D. Hsu & C. Monteleoni, "A general agnostic active learning algorithm," Advances in Neural Information Processing Systems 20 (2007).
- S. Hanneke, "Theory of disagreement-based active learning," Foundations and Trends in Machine Learning 7(2–3), 131–309 (2014).