Importance Weighted Active Learning
We present a practical and statistically consistent scheme for actively learning binary classifiers under general loss functions. Our algorithm uses importance weighting to correct sampling bias, and by controlling the variance, we are able to give rigorous label complexity bounds for the learning process. Experiments on passively labeled data show that this approach reduces the label complexity required to achieve good predictive performance on many learning problems.
Keywords: Active learning, importance weighting, sampling bias
Active learning is typically defined by contrast to the passive model of supervised learning. In passive learning, all the labels for an unlabeled dataset are obtained at once, while in active learning the learner interactively chooses which data points to label. The great hope of active learning is that interaction can substantially reduce the number of labels required, making learning more practical. This hope is known to be valid in certain special cases, where the number of labels needed to learn actively has been shown to be logarithmic in the usual sample complexity of passive learning; such cases include thresholds on a line, and linear separators with a spherically uniform unlabeled data distribution (Dasgupta et al., 2005).
Many earlier active learning algorithms, such as (Cohn et al., 1994; Dasgupta et al., 2005), have problems with data that are not perfectly separable under the given hypothesis class. In such cases, they can exhibit a lack of statistical consistency: even with an infinite labeling budget, they might not converge to an optimal predictor (see Dasgupta and Hsu (2008) for a discussion).
This problem has recently been addressed in two threads of research. One approach (Balcan et al., 2006; Dasgupta et al., 2008; Hanneke, 2007) constructs learning algorithms that explicitly use sample complexity bounds to assess which hypotheses are still “in the running” (given the labels seen so far), thereby assessing the relative value of different unlabeled points (in terms of whether they help distinguish between the remaining hypotheses). These algorithms have the usual PAC-style convergence guarantees, but they also have rigorous label complexity bounds that are in many cases significantly better than the bounds for passive supervised learning. However, these algorithms have yet to see practical use. First, they are built explicitly for – loss and are not easily adapted to most other loss functions. This is problematic because in many applications, other loss functions are more appropriate for describing the problem, or make learning more tractable (as with convex proxy losses on linear representations). Second, these algorithms make internal use of generalization bounds that are often loose in practice, and they can thus end up requiring far more labels than are really necessary. Finally, they typically require an explicit enumeration over the hypothesis class (or an -cover thereof), which is generally computationally intractable.
The second approach to active learning uses importance weights to correct sampling bias (Bach, 2007; Sugiyama, 2006). This approach has only been analyzed in limited settings. For example, (Bach, 2007) considers linear models and provides an analysis of consistency in cases where either (i) the model class fits the data perfectly, or (ii) the sampling strategy is non-adaptive (that is, the data point queried at time doesn’t depend on the sequence of previous queries). The analysis in these works is also asymptotic rather than yielding finite label bounds, while minimizing the actual label complexity is of paramount importance in active learning. Furthermore, the analysis does not prescribe how to choose importance weights, and a poor choice can result in high label complexity.
Importance-weighted active learning
We address the problems above with an active learning scheme that provably yields PAC-style label complexity guarantees. When presented with an unlabeled point , this scheme queries its label with a carefully chosen probability , taking into account the identity of the point and the history of labels seen so far. The points that end up getting labeled are then weighted according to the reciprocals of these probabilities (that is, ), in order to remove sampling bias. We show (theorem 1) that this simple method guarantees statistical consistency: for any distribution and any hypothesis class, active learning eventually converges to the optimal hypothesis in the class.
As in any importance sampling scenario, the biggest challenge is controlling the variance of the process. This depends crucially on how the sampling probability is chosen. Our strategy, roughly, is to make it proportional to the spread of values , as ranges over the remaining candidate hypotheses (those with good performance on the labeled points so far). For this setting of , which we call IWAL(loss-weighting), we have two results. First, we show (theorem 2) a fallback guarantee that the label complexity is never much worse than that of supervised learning. Second, we rigorously analyze the label complexity in terms of underlying parameters of the learning problem (theorem 7). Previously, label complexity bounds for active learning were only known for – loss, and were based on the disagreement coefficient of the learning problem (Hanneke, 2007). We generalize this notion to general loss functions, and analyze label complexity in terms of it. We consider settings in which these bounds turn out to be roughly the square root of the sample complexity of supervised learning.
We conduct practical experiments with two IWAL algorithms. The first is a specialization of IWAL(loss-weighting) to the case of linear classifiers with convex loss functions; here, the algorithm becomes tractable via convex programming (section 7). The second, IWAL(bootstrap), uses a simple bootstrapping scheme that reduces active learning to (batch) passive learning without requiring much additional computation (section 7.2). In every case, these experiments yield substantial reductions in label complexity compared to passive learning, without compromising predictive performance. They suggest that IWAL is a practical scheme that can reduce the label complexity of active learning without sacrificing the statistical guarantees (like consistency) we take for granted in passive learning.
Other related work
The active learning algorithms of Abe and Mamitsuka (1998), based on boosting and bagging, are similar in spirit to our IWAL(bootstrap) algorithm in section 7.2. But these earlier algorithms are not consistent in the presence of adversarial noise: they may never converge to the correct solution, even given an infinite label budget. In contrast, IWAL(bootstrap) is consistent and satisfies further guarantees (section 2).
The field of experimental design (Pukelsheim, 2006) emphasizes regression problems in which the conditional distribution of the response variable given the predictor variables is assumed to lie in a certain class; the goal is to synthesize query points such that the resulting least-squares estimator has low variance. In contrast, we are interested in an agnostic setting, where no assumptions about the model class being powerful enough to represent the ideal solution exist. Moreover, we are not allowed to synthesize queries, but merely to choose them from a stream (or pool) of candidate queries provided to us. A telling difference between the two models is that in experimental design, it is common to query the same point repeatedly, whereas in our setting this would make no sense.
Let be the input space and the output space. We consider active learning in the streaming setting where at each step , a learner observes an unlabeled point and has to decide whether to ask for the label . The learner works with a hypothesis space , where is a prediction space.
The algorithm is evaluated with respect to a given loss function . The most common loss function is – loss, in which and . The following examples address the binary case with :
(squared loss), and
Notice that all the loss functions mentioned here are of the form for some function on the reals. We specifically highlight this subclass of loss functions when proving label complexity bounds. Since these functions are bounded (if is), we further assume they are normalized to output a value in .
3 The Importance Weighting Skeleton
Algorithm 1 describes the basic outline of importance-weighted active learning (IWAL). Upon seeing , the learner calls a subroutine rejection-threshold (instantiated in later sections), which looks at and past history to return the probability of requesting .
The algorithm maintains a set of labeled examples seen so far, each with an importance weight: if ends up being queried, its weight is set to .
Let be the underlying probability distribution on . The expected loss of on is given by . Since is always clear from context, we drop it from notation. The importance weighted estimate of the loss at time is
where is as defined in the algorithm. It is easy to see that , with the expectation taken over all the random variables involved. Theorem 2 gives large deviation bounds for , provided that the probabilities are chosen carefully.
3.1 A safety guarantee for IWAL
A desirable property for a learning algorithm is consistency: Given an infinite budget of unlabeled and labeled examples, does it converge to the best predictor? Some early active learning algorithms (Cohn et al., 1994; Dasgupta et al., 2005) do not satisfy this baseline guarantee: they have problems if the data cannot be classified perfectly by the given hypothesis class. We prove that IWAL algorithms are consistent, as long as is bounded away from . Further, we prove that the label complexity required is within a constant factor of supervised learning in the worst case.
For all distributions , for all finite hypothesis classes , for any , if there is a constant such that for all , then
Comparing this result to the usual sample complexity bounds in supervised learning (for example, corollary 4.2 of (Langford, 2005)), we see that the label complexity is at most times that of a supervised algorithm. For simplicity, the bound is given in terms of rather than the VC dimension of . The argument, which is a martingale modification of standard results, can be extended to VC spaces.
Proof Fix the underlying distribution. For a hypothesis , consider a sequence of random variables with
Since , . The sequence is a martingale, letting . Indeed, for any ,
Observe that for all . Using and applying Azuma’s inequality (Azuma, 1967), we see that for any ,
Setting and taking a union bound over
then yields the desired result.
4 Setting the Rejection Threshold: Loss Weighting
Algorithm 2 gives a particular instantiation of the rejection threshold subroutine in IWAL. The subroutine maintains an effective hypothesis class , which is initially all of and then gradually shrinks by setting to the subset of whose empirical loss isn’t too much worse than , the smallest empirical loss in :
The allowed slack comes from a standard sample complexity bound.
We will show that, with high probability, any optimal hypothesis is always in , and thus all other hypotheses can be discarded from consideration. For each , the loss-weighting scheme looks at the range of predictions on made by hypotheses in and sets the sampling probability to the size of this range. More precisely,
Since the loss values are normalized to lie in , we can be sure that is also in this interval. Next section shows that the resulting IWAL has several desirable properties.
4.1 A generalization bound
We start with a large deviation bound for each output by IWAL(loss-weighting). It is not a corollary of theorem 1 because it does not require the sampling probabilities be bounded below away from zero.
Pick any data distribution and hypothesis class , and let be a minimizer of the loss function with respect to . Pick any . With probability at least , for any ,
for any .
In particular, if is the output of IWAL(loss-weighting), then .
We need the following lemma for the proof.
For all data distributions , for all hypothesis classes , for all , with probability at least , for all and all ,
Proof Pick any and . Define
Then . Thus is a martingale difference sequence, and we can use Azuma’s inequality to show that its sum is tightly concentrated, if the individual are bounded.
To check boundedness, observe that since and are in , they must also be in . Thus for all , , whereupon
We allow failure probability at time . Applying Azuma’s inequality, we have
Since is a random subset of , it suffices to take a union bound over all , and . A union bound over finishes the
Proof (Theorem 2) Start by assuming that the probability event of lemma 1 holds. We first show by induction that is in for all . It holds at , since . Now suppose it holds at , and show that it is true at . Let minimize over . By lemma 1, Thus and hence .
Since , lemma 1 implies that for for any ,
Since , we have .
5 Label Complexity
We showed that the loss of the classifier output by IWAL(loss-weighting) is similar to the loss of the classifier chosen passively after seeing all labels. How many of those labels does the active learner request?
Dasgupta et al. (2008) studied this question for an active learning scheme under – loss. For learning problems with bounded disagreement coefficient (Hanneke, 2007), the number of queries was found to be , where is the VC dimension of the function class, and is the best error rate achievable on the underlying distribution by that function class. We will soon see (section 6) that the term is inevitable for any active learning scheme; the remaining term has just a polylogarithmic dependence on .
We generalize the disagreement coefficient to arbitrary loss functions and show that, under conditions similar to the earlier result, the number of queries is , where is now the best achievable loss. The inevitable is still there, and the second term is still sublinear, though not polylogarithmic as before.
5.1 Label Complexity: Main Issues
Suppose the loss function is minimized by , with . Theorem 2 shows that at time , the remaining hypotheses include and all have losses in the range . We now prove that under suitable conditions, the sampling probability has expected value . Thus the expected total number of labels queried upto time is roughly .
To motivate the proof, consider a loss function ; all our examples are of this form. Say is differentiable with . Then the sampling probability for is
So is determined by the range of predictions on by hypotheses in . Can we bound the size of this range, given that any has loss at most ?
So we can upperbound (in terms of and ), whereas we want to upperbound the expected value of , which is proportional to . The ratio between these two quantities is related to a fundamental parameter of the learning problem, a generalization of the disagreement coefficient (Hanneke, 2007).
We flesh out this intuition in the remainder of this section. First we describe a broader class of loss functions than those considered above (including – loss, which is not differentiable); a distance metric on hypotheses, and a generalized disagreement coefficient. We then prove that for this broader class, active learning performs better than passive learning when the generalized disagreement coefficient is small.
5.2 A subclass of loss functions
We give label complexity upper bounds for a class of loss functions that includes – loss and logistic loss but not hinge loss. Specifically, we require that the loss function has bounded slope asymmetry, defined below.
Recall earlier notation: response space , classifier space , and loss function . Henceforth, the label space is .
The slope asymmetry of a loss function is
The slope asymmetry is for – loss, and for hinge loss. For differentiable loss functions , it is easily related to bounds on the derivative.
Let , where is a differentiable function defined on . Suppose for all . Then for any , and any ,
Thus has slope asymmetry at most .
By the mean value theorem, there is some such that
the rest follows from the bounds on .
For instance, this immediately applies to logistic loss.
Logistic loss , defined on label space and response space , has slope asymmetry at most .
5.3 Topologizing the space of classifiers
We introduce a simple distance function on the space of classifiers.
For any and distribution define . For any , let .
Suppose is realized at . We know that at time , the remaining hypotheses have loss at most . Does this mean they are close to in -distance? The ratio between the two can be expressed in terms of the slope asymmetry of the loss.
For any distribution and any loss function with slope asymmetry , we have for all .
Proof For any ,
5.4 A generalized disagreement coefficient
When analyzing the algorithm (Balcan et al., 2006) for active learning under – loss, Hanneke (2007) found that its label complexity could be characterized in terms of what he called the disagreement coefficient of the learning problem. We now generalize this notion to arbitrary loss functions.
The disagreement coefficient is the infimum value of such that for all ,
Here is a simple example for linear separators.
Suppose consists of linear classifiers and the data distribution is uniform over the surface of the unit sphere in . Suppose the loss function is for differentiable with . Then the disagreement coefficient is at most .
Proof Let be the optimal classifier, and any other classifier with . Let be the corresponding vectors in . Using lemma 2,
Thus for any , we have that the corresponding vectors satisfy . We can now bound the disagreement coefficient:
5.5 Upper Bound on Label Complexity
Finally, we give a bound on label complexity for learning problems with bounded disagreement coefficient and loss functions with bounded slope asymmetry.
For all learning problems and hypothesis spaces , if the loss function has slope asymmetry , and the learning problem has disagreement coefficient , then for all , with probability at least over the choice of data, the expected number of labels requested by IWAL(loss-weighting) during the first iterations is at most
where is the minimum loss achievable on by , and the expectation is over the randomness in the selective sampling.
5.6 Other examples of low label complexity
It is also sometimes possible to achieve substantial label complexity reductions over passive learning, even when the slope asymmetry is infinite.
Let the space be the ball of radius in dimensions.
Let the distribution on be a point mass at the origin with weight and label and a point mass at with weight and label half the time and label for the other half the time.
Let the hypothesis space be linear with weight vectors satisfying .
Let the loss of interest be squared loss: which has infinite slope asymmetry.
For the example above, IWAL(loss-weighting) requires only an expected fraction of the labeled samples of passive learning to achieve the same loss.
Proof Passive learning samples from the point mass at the origin a fraction of the time, while active learning only samples from the point mass at since all predictors have the same loss on samples at the origin.
Since all hypothesis have the same loss for samples at the origin,
only samples not at the origin influence the sample complexity.
Active learning samples from points not at the origin more
often than passive learning, implying the theorem.
6 A lower bound on label complexity
(Kääriäinen, 2006) showed that for any hypothesis class and any , there is a data distribution such that (a) the optimal error rate achievable by is ; and (b) any active learner that finds with error rate (with probability ) must make queries. We now strengthen this lower bound to , where is the VC dimension of .
Let’s see how this relates to the label complexity rates of the previous section. It is well-known that if a supervised learner sees examples (for any ), its final hypothesis has error (Devroye et al., 1996) with high probability. Think of this as for . Our lower bound now implies that an active learner must make at least queries. This explains the leading term in all the label complexity bounds we have discussed.
For any such that , for any input space and hypothesis class (of functions mapping into ) of VC dimension , there is a distribution over such that (a) the best error rate achievable by is ; (b) any active learner seeking a classifier of error at most must make queries to succeed with probability at least .
Proof Pick a set of points shattered by . Here is a distribution over : point has probability , while each of the remaining has probability , where . At , the response is always . At , the response is with probability , where is either or , and .
Nature starts by picking uniformly at random. This defines the target hypothesis : and . Its error rate is .
Any learner outputs a hypothesis in and thus implicitly makes guesses at the underlying hidden bits . Unless it correctly determines for at least of the points , the error of its hypothesis will be at least .
Now, suppose the active learner makes queries, where is a small constant ( suffices). We’ll show that it fails (outputs a hypothesis with error ) with probability at least .
We’ll say is heavily queried if the active learner queries it at least times. At most of the ’s are heavily queried; without loss of generality, these are , for some . The remaining get so few queries that the learner guesses each corresponding bit with probability less than ; this can be derived from Slud’s lemma (below), which relates the tails of a binomial to that of a normal.
Let denote the event that the learner gets wrong; so for . Since , the probability that the learner fails is given by
where is a random variable,
is a standard normal, and the last inequality follows from Slud’s lemma.
Thus the active learner must make at least
queries to succeed with probability at least .
Lemma 5 (Slud (1977))
Let be a Binomial random variable with , and let be a standard normal. For any ,
Theorem 9 uses the same example that is used for lower bounds on supervised sample complexity (section 14.4 of (Devroye et al., 1996)), although in that case the lower bound is . The bound for active learning is smaller by a factor of because the active learner can avoid making repeated queries to the “heavy” point , whose label is immediately obvious.
7 Implementing IWAL
IWAL(loss-weighting) can be efficiently implemented in the case where is the class of bounded-length linear separators and the loss function is convex: for convex .
Each iteration of Algorithm 2 involves solving two optimization problems over a restricted hypothesis set
Replacing each by its corresponding vector , this is
an intersection of convex constraints.
The first optimization in Algorithm 2 is , a convex program.
The second optimization is (where correspond to functions ). If is nonincreasing (as it is for –, hinge, or logistic loss), then the solution of this problem is , where is the solution of a convex program: The two cases inside the max correspond to the choices and .
Thus Algorithm 2 can be efficiently implemented for nonincreasing convex loss functions and bounded-length linear separators. In our experiments, we use a simpler implementation. For the first problem (determining ), we minimize over rather than ; for the second (determining ), instead of defining by convex constraints, we simply enforce the last of these constraints (corresponding to time ). This may lead to an overly conservative choice of , but by theorem 1, the consistency of is assured.
Recent consistent active learning algorithms (Balcan et al., 2006; Dasgupta et al., 2008) have suffered from computational intractability. This section shows that importance weighted active learning is practical.
We implemented IWAL with loss-weighting for linear separators under logistic loss. As outlined above, the algorithm involves two convex optimizations as subroutines. These were coded using log-barrier methods (section 11.2 of (Boyd and Vandenberghe, 2004)). We tried out the algorithm on the MNIST data set of handwritten digits by picking out the 3’s and 5’s as two classes, and choosing 1000 exemplars of each for training and another 1000 of each for testing. We used PCA to reduce the dimension from 784 to 25. The algorithm uses a generalization bound of the form ; since this is believed to often be loose in high dimensions, we also tried a more optimistic bound of . In either case, active learning achieved very similar performance (in terms of test error or test logistic loss) to a supervised learner that saw all the labels. The active learner asked for less than of the labels.
7.2 Bootstrap instantiation of IWAL
This section reports another practical implementation of IWAL, using a simple bootstrapping scheme to compute the rejection threshold. A set of predictors is trained on some initial set of labeled examples and serves as an approximation of the version space. Given a new unlabeled example , the sampling probability is set to , where is a lower bound on the sampling probability.
We implemented this scheme for binary and multiclass classification loss, using 10 decision trees bootstrapped on the initial 1/10th of the training set, setting . For simplicity, we did’t retrain the predictors for each new queried point, i.e., the predictors were trained once on the initial sample. The final predictor is trained on the collected importance-weighted training set, and tested on the test set. The Costing technique (Zadrozny et al., 2003) was used to remove the importance weights using rejection sampling. (The same technique can be applied to any loss function.) The resulting unweighted classification problem was then solved using a decision tree learner (J48). On the same MNIST dataset as in section 7.1, the scheme performed just as well as passive learning, using only 65.6% of the labels (see Figure 2).
The following table reports additional experiments performed on standard benchmark datasets, bootstrapped on the initial 10%.
|error rate||error rate||split|
The IWAL algorithms and analysis presented here remove many reasonable objections to the deployment of active learning. IWAL satisfies the same convergence guarantee as common supervised learning algorithms, it can take advantage of standard algorithms (section 7.2), it can deal with very flexible losses, and in theory and practice it can yield substantial label complexity improvements.
Empirically, in every experiment we have tried, IWAL has substantially reduced the label complexity compared to supervised learning, with no sacrifice in performance on the same number of unlabeled examples. Since IWAL explicitly accounts for sample selection bias, we can be sure that these experiments are valid for use in constructing new datasets. This implies another subtle advantage: because the sampling bias is known, it is possible to hypothesize and check the performance of IWAL algorithms on datasets drawn by IWAL. This potential for self-tuning off-policy evaluation is extremely useful when labels are expensive.
We would like to thank Alex Strehl for a very careful reading which caught a couple proof bugs.
- Abe and Mamitsuka (1998) N. Abe and H. Mamitsuka. Query learning strategies using boosting and bagging. In Proceedings of the International Conference on Machine Learning, pages 1–9, 1998.
- Azuma (1967) K. Azuma. Weighted sums of certain dependent random variables. Tohoku Mathematical J., 68:357–367, 1967.
- Bach (2007) F. Bach. Active learning for misspecified generalized linear models. In Advances in Neural Information Processing Systems 19. MIT Press, Cambridge, MA, 2007.
- Balcan et al. (2006) M.-F. Balcan, A. Beygelzimer, and J. Langford. Agnostic active learning. In William W. Cohen and Andrew Moore, editors, Proceedings of the International Conference on Machine Learning, volume 148, pages 65–72, 2006.
- Boyd and Vandenberghe (2004) S. Boyd and L Vandenberghe. Convex Optimization. Cambridge University Press, 2004.
- Cohn et al. (1994) D. Cohn, L. Atlas, and R. Ladner. Improving generalization with active learning. Machine Learning, 15(2):201–221, 1994.
- Dasgupta and Hsu (2008) S. Dasgupta and D. Hsu. Hierarchical sampling for active learning. In Proceedings of the 25th International Conference on Machine learning, pages 208–215, 2008.
- Dasgupta et al. (2005) S. Dasgupta, A. Tauman Kalai, and C. Monteleoni. Analysis of perceptron-based active learning. In Proc. of the Annual Conference on Learning Theory, pages 249–263, 2005.
- Dasgupta et al. (2008) S. Dasgupta, D. Hsu, and C. Monteleoni. A general agnostic active learning algorithm. In Advances in Neural Information Processing Systems, volume 20, pages 353–360. 2008.
- Devroye et al. (1996) L. Devroye, L. Gyorfi, and G. Lugosi. A Probabilistic Theory of Pattern Recognition. Springer, 1996.
- Hanneke (2007) S. Hanneke. A bound on the label complexity of agnostic active learning. In Proceedings of the 24th International Conference on Machine Learning, pages 353–360, 2007.
- Kääriäinen (2006) M. Kääriäinen. Active learning in the non-realizable case. In Proceedings of 17th International Conference on Algorithmic Learning Theory, pages 63–77, 2006.
- Langford (2005) J. Langford. Practical prediction theory for classification. J. of Machine Learning Research, 6:273–306, 2005.
- Pukelsheim (2006) F. Pukelsheim. Optimal Design of Experiments, volume 50 of Classics in Applied Mathematics. Society for Industrial and Applied Mathematics, 2006.
- Slud (1977) E. Slud. Distribution inequalities for the binomial law. Annals of Probability, 5:404–412, 1977.
- Sugiyama (2006) M. Sugiyama. Active learning for misspecified models. In Advances in Neural Information Processing Systems, volume 18, pages 1305–1312. MIT Press, Cambridge, MA, 2006.
- Zadrozny et al. (2003) B. Zadrozny, J. Langford, and N. Abe. Cost-sensitive learning by cost-proportionate example weighting. In Proceedings of the Third IEEE International Conference on Data Mining, pages 435–442, 2003.