Title: DEEP BATCH ACTIVE LEARNING BY DIVERSE, UNCERTAIN GRADIENT LOWER BOUNDS

Abstract: We design a new algorithm for batch active learning with deep neural network models. Our algorithm, Batch Active learning by Diverse Gradient Embeddings (BADGE), samples groups of points that are disparate and high magnitude when represented in a hallucinated gradient space, a strategy designed to incorporate both predictive uncertainty and sample diversity into every selected batch. Crucially, BADGE trades off between uncertainty and diversity without requiring any hand-tuned hyperparameters. While other approaches sometimes succeed for particular batch sizes or architectures, BADGE consistently performs as well or better, making it a useful option for real world active learning problems. K i=1 I(y = i) ln 1 /pi = ln 1 /py.

1. INTRODUCTION:

In recent years, deep neural networks have produced state-of-the-art results on a variety of important supervised learning tasks. However, many of these successes have been limited to domains where large amounts of labeled data are available. A promising approach for minimizing labeling effort is active learning, a learning protocol where labels can be requested by the algorithm in a sequential, feedback-driven fashion. Active learning algorithms aim to identify and label only maximally-informative samples, so that a high-performing classifier can be trained with minimal labeling effort. As such, a robust active learning algorithm for deep neural networks may considerably expand the domains in which these models are applicable.

How should we design a practical, general-purpose, label-efficient active learning algorithm for deep neural networks? Theory for active learning suggests a version-space-based approach (Cohn et al., 1994; Balcan et al., 2006) , which explicitly or implicitly maintains a set of plausible models, and queries examples for which these models make different predictions. But when using highly expressive models like neural networks, these algorithms degenerate to querying every example. Further, the computational overhead of training deep neural networks precludes approaches that update the model to best fit data after each label query, as is often done (exactly or approximately) for linear methods (Beygelzimer et al., 2010; Cesa-Bianchi et al., 2009) . Unfortunately, the theory provides little guidance for these models.

One option is to use the network's uncertainty to inform a query strategy, for example by labeling samples for which the model is least confident. In a batch setting, however, this creates a pathological scenario where data in the batch are nearly identical, a clear inefficiency. Remedying this issue, we could select samples to maximize batch diversity, but this might choose points that provide little new information to the model. For these reasons, methods that exploit just uncertainty or diversity do not consistently work well across model architectures, batch sizes, or datasets. An algorithm that performs well when using a ResNet, for example, might perform poorly when using a multilayer perceptron. A diversity-based approach might work well when the batch size is very large, but poorly when the batch size is small. Further, what even constitutes a "large" or "small" batch size is largely a function of the statistical properties of the data in question. These weaknesses pose a major problem for real, practical batch active learning situations, where data are unfamiliar and potentially unstructured. There is no way to know which active learning algorithm is best to use.

Moreover, in a real active learning scenario, every change of hyperparameters typically causes the algorithm to label examples not chosen under other hyperparameters, provoking substantial labeling inefficiency. That is, hyperparameter sweeps in active learning can be label expensive. As a result, active learning algorithms need to "just work", given fixed hyperparameters, to a greater extent than is typical for supervised learning.

Based on these observations, we design an approach which creates diverse batches of examples about which the current model is uncertain. We measure uncertainty as the gradient magnitude with respect to parameters in the final (output) layer, which is computed using the most likely label according to the model. To capture diversity, we collect a batch of examples where these gradients span a diverse set of directions. More specifically, we build up the batch of query points based on these hallucinated gradients using the k-MEANS++ initialization (Arthur and Vassilvitskii, 2007) , which simultaneously captures both the magnitude of a candidate gradient and its distance from previously included points in the batch. We name the resulting approach Batch Active learning by Diverse Gradient Embeddings (BADGE).

We show that BADGE is robust to architecture choice, batch size, and dataset, generally performing as well as or better than the best baseline across our experiments, which vary all of the aforementioned environmental conditions. We begin by introducing our notation and setting, followed by a description of the BADGE algorithm in Section 3 and experiments in Section 4. We defer our discussion of related work to Section 5.

2. NOTATION AND SETTING:

Define [K] := {1, 2, . . . , K}. Denote by X the instance space and by Y the label space. In this work we consider multiclass classification, so Y = [K] . Denote by D the distribution from which examples are drawn, by D X the unlabeled data distribution, and by D Y|X the conditional distribution over labels given examples. We consider the pool-based active learning setup, where the learner receives an unlabeled dataset U sampled according to D X and can request labels sampled according to D Y|X for any x ∈ U . We use E D to denote expectation under the data distribution D. Given a classifier h : X → Y, which maps examples to labels, and a labeled example (x, y), we denote the 0/1 error of h on (x, y) as 01 (h(x), y) = I(h(x) = y). The performance of a classifier h is measured by its expected 0/1 error, i.e. E D [ 01 (h(x), y)] = Pr (x,y)∼D (h(x) = y). The goal of pool-based active learning is to find a classifier with a small expected 0/1 error using as few label queries as possible. Given a set S of labeled examples (x, y), where each x ∈ S is picked from U , followed by a label query, we use E S as the sample averages over S.

In this paper, we consider classifiers h parameterized by underlying neural networks f of fixed architecture, with the weights in the network denoted by θ. We abbreviate the classifier with parameters θ as h θ since the architectures are fixed in any given context, and our classifiers take the form For all examples x in U \ S:

h θ (x) = argmax y∈[K] f (x; θ) y , where f (x; θ) ∈ R K is

1. Compute its hypothetical label ŷ(x) = h θt (x).

2. Compute gradient embedding g x = ∂ ∂θout CE (f (x; θ), ŷ(x))| θ=θt , where θ out refers to parameters of the final (output) layer.

5::

Compute S t , a random subset of U \ S, using the k-MEANS++ seeding algorithm on {g x : x ∈ U \ S} and query for their labels. 3 ALGORITHM BADGE, described in Algorithm 1, starts by drawing an initial set of M examples uniformly at random from U and asking for their labels. It then proceeds iteratively, performing two main computations at each step t: a gradient embedding computation and a sampling computation. Specifically, at each step t, for every x in the pool U , we compute the label ŷ(x) preferred by the current model, and the gradient g x of the loss on (x, ŷ(x)) with respect to the parameters of the last layer of the network. Given these gradient embedding vectors {g x : x ∈ U }, BADGE selects a set of points by sampling via the k-MEANS++ initialization scheme (Arthur and Vassilvitskii, 2007) . The algorithm queries the labels of these examples, retrains the model, and repeats.

We now describe the main computations -the embedding and sampling steps -in more detail.

The gradient embedding. Since deep neural networks are optimized using gradient-based methods, we capture uncertainty about an example through the lens of gradients. In particular, we consider the model uncertain about an example if knowing the label induces a large gradient of the loss with respect to the model parameters and hence a large update to the model. A difficulty with this reasoning is that we need to know the label to compute the gradient. As a proxy, we compute the gradient as if the model's current prediction on the example is the true label. We show in Proposition 1 that, assuming a common structure satisfied by most natural neural networks, the gradient norm with respect to the last layer using this label provides a lower bound on the gradient norm induced by any other label. In addition, under that assumption, the length of this hypothetical gradient vector captures the uncertainty of the model on the example: if the model is highly certain about the example's label, then the example's gradient embedding will have a small norm, and vice versa for samples where the model is uncertain (see example below). Thus, the gradient embedding conveys information both about the model's uncertainty and potential update direction upon receiving a label at an example.

The sampling step. We want the newly-acquired labeled samples to induce large and diverse changes to the model. To this end, we want the selection procedure to favor both sample magnitude and batch diversity. Specifically, we want to avoid the pathology of, for example, selecting a batch of k similar samples where even just a single label could alleviate our uncertainty on all remaining (k -1) samples.

A natural way of making this selection without introducing additional hyperparameters is to sample from a k-Determinantal Point Process (k-DPP; (Kulesza and Taskar, 2011) with probability proportional to the determinant of their Gram matrix. Recently, Dereziński and Warmuth (2018) showed that in experimental design for least square linear regression settings, learning from samples drawn from a k-DPP can have much smaller mean square prediction error than learning from iid samples. In this process, when the batch size is very low, the selection will naturally favor points with a large length, which corresponds to uncertainty in our space. When the batch size is large, the sampler focuses more on diversity because linear independence, which is more difficult to achieve for large k, is required to make the Gram determinant non-zero.

Unfortunately, sampling from a k-DPP is not trivial. Many sampling algorithms (Kang, 2013; Anari et al., 2016) rely on MCMC, where mixing time poses a significant computational hurdle. The state-of-the-art algorithm of Dereziński (2018) has a high-order polynomial running time in the batch size and the embedding dimension. To overcome this computational hurdle, we suggest instead sampling using the k-MEANS++ seeding algorithm (Arthur and Vassilvitskii, 2007) , originally made to produce a good initialization for k-means clustering. k-MEANS++ seeding selects centroids by iteratively sampling points in proportion to their squared distances from the nearest centroid that has already been chosen, which, like a k-DPP, tends to select a diverse batch of high-magnitude samples. For completeness, we give a formal description of the k-MEANS++ seeding algorithm in Appendix A.

Example: multiclass classification with softmax activations. Consider a neural network f where the last nonlinearity is a softmax, i.e. σ(z) i = e z i / K j=1 e z j . Specifically, f is parametrized by θ = (W, V ), where θ out = W = (W 1 , . . . , W K ) ∈ R K×d are the weights of the last layer, and V consists of weights of all previous layers. This means that f (x; θ) = σ(W • z(x; V )), where z is the nonlinear function that maps an input x to the output of the network's penultimate layer. Let us fix an unlabeled sample x and define p i = f (x; θ) i . With this notation, we have y ) for a label y and g x = g ŷ x as the gradient embedding in our algorithm, where ŷ = argmax i∈[K] p i . Then the i-th block of g x (i.e. the gradients corresponding to label i) is

CE (f (x; θ), y) = ln   K j=1 e Wj •z(x;V )   -W y • z(x; V ). Define g y x = ∂ ∂W CE (f (x; θ),

EQUATION

Based on this expression, we can make the following observations:

1. Each block of g x is a scaling of z(x; V ), which is the output of the penultimate layer of the network. In this respect, g x captures x's representation information similar to that of Sener and Savarese (2018) . 2. Proposition 1 below shows that the norm of g x is a lower bound on the norm of the loss gradient induced by the example with true label y with respect to the weights in the last layer, that is g x ≤ g y x . This suggests that the norm of g x conservatively estimates the example's influence on the current model. 3. If the current model θ is highly confident about x, i.e. vector p is skewed towards a standard basis vector e j , then ŷ = j, and vector (p i -I(ŷ = i)) K i=1 has a small length. Therefore, g x has a small length as well. Such high-confidence examples tend to have gradient embeddings of small magnitude, which are unlikely to be repeatedly selected by k-MEANS++ at iteration t. Proposition 1. For all y ∈ {1, . . . , K}, let g y x = ∂ ∂W CE (f (x; θ), y). Then

g y x 2 = K i=1 p 2 i + 1 -2p y z(x; V ) 2 .

Consequently, ŷ = argmin y∈[K] g y x .

Proof. Observe that by Equation (1),

g y x 2 = K i=1 p i -I(y = i) 2 z(x; V ) 2 = K i=1 p 2 i + 1 -2p y z(x; V ) 2 .

The second claim follows from the fact that ŷ = argmax y∈[K] p y .

This simple sampler tends to produce diverse batches similar to a k-DPP. As shown in Figure 1 , switching between the two samplers does not affect the active learner's statistical performance but greatly improves its computational performance. Appendix G compares run time and test accuracy for both k-MEANS++ and k-DPP based sampling based on the gradient embeddings of the unlabeled examples.

Figure 2 illustrates the batch diversity and average gradient magnitude per selected batch for a variety of sampling strategies. As expected, both k-DPPs and k-MEANS++ tend to select samples that are diverse (as measured by the magnitude of their Gram determinant) and high magnitude. Other samplers, such as furthest-first traversal for k-Center clustering (FF-k-CENTER), do not seem to have this property. The FF-k-CENTER algorithm is the sampling choice of the CORESET approach to active learning, which we describe in the proceeding section (Sener and Savarese, 2018) . Appendix F discusses diversity with respect to uncertainty-based approaches.

Appendix B provides further justification for why BADGE yields better updates than vanilla uncertainty sampling in the special case of binary logistic regression (K = 2 and z(x; V ) = x).

4. EXPERIMENTS:

We evaluate the performance of BADGE against several algorithms from the literature. In our experiments, we seek to answer the following question: How robust are the learning algorithms to choices of neural network architecture, batch size, and dataset?

To ensure a comprehensive comparison among all algorithms, we evaluate them in a batch-mode active learning setup with M = 100 being the number of initial random labeled examples and batch size B varying from {100, 1000, 10000}. The following is a list of the baseline algorithms evaluated; the first performs representative sampling, the next three are uncertainty based, the fifth is a hybrid of representative and uncertainty-based approaches, and the last is traditional supervised learning. The average embedding magnitude (a measurement of predictive uncertainty) in the selected batch. The FF-k-CENTER sampler finds points that are not as diverse or high-magnitude as other samplers. Notice also that k-MEANS++ tends to actually select samples that are both more diverse and higher-magnitude than a k-DPP, a potential pathology of the k-DPP's degree of stochastisity. Standard errors are shown by shaded regions.

k-DPP k-means++:

1. CORESET: A diversity-based approach using coreset selection. The embedding of each example is computed by the network's penultimate layer and the samples at each round are selected using a greedy furthest-first traversal conditioned on all labeled examples (Sener and Savarese, 2018).

2.. CONF (Confidence Sampling): An uncertainty-based active learning algorithm that selects B:

examples with smallest predicted class probability, max K i=1 f (x; θ) i (e.g. Wang and Shang, 2014) .

3.. MARG (Margin Sampling): An uncertainty-based active learning algorithm that selects the bottom B:

examples sorted according to the example's multiclass margin, defined as f (x; θ) ŷ -f (x; θ) y , where ŷ and y are the indices of the largest and second largest entries of f (x; θ) (Roth and Small, 2006) . 4. ENTROPY: An uncertainty-based active learning algorithm that selects the top B examples according to the entropy of the example's predictive class probability distribution, defined as (Wang and Shang, 2014) . 5. ALBL (Active Learning by Learning): A bandit-style meta-active learning algorithm that selects between CORESET and CONF at every round (Hsu and Lin, 2015) . 6. RAND: The naive baseline of randomly selecting k examples to query at each round.

H((f (x; θ) y ) K y=1 ), where H(p) = K i=1 p i ln 1 /pi

We consider three neural network architectures: a two-layer Perceptron with ReLU activations (MLP), an 18-layer convolutional ResNet (He et al., 2016) , and an 11-layer VGG network (Simonyan and Zisserman, 2014) . We evaluate our algorithms using three image datasets, SVHN (Netzer et al., 2011) , CIFAR10 (Krizhevsky, 2009) and MNIST (LeCun et al., 1998) 1 , and four non-image datasets from the OpenML repository (#6, #155, #156, and #184). 2 We study each situation with 7 active learning algorithms, including BADGE, making for 231 total experiments.

For the image datasets, the embedding dimensionality in the MLP is 256. For the OpenML datasets, the embedding dimensionality of the MLP is 1024, as more capacity helps the model fit training data. We fit Learning curves. Here we show examples of learning curves that highlight some of the phenomena we observe related to the fragility of active learning algorithms with respect to batch size, architecture, and dataset.

Often, we see that in early rounds of training, it is better to do diversity sampling, and later in training, it is better to do uncertainty sampling. This kind of event is demonstrated in Figure 3a , which shows CORESET outperforming confidence-based methods at first, but then doing worse than these methods later on. Element Pi,j corresponds roughly to the number of times algorithm i outperforms algorithm j. Column-wise averages at the bottom show overall performance (lower is better).

In this figure, BADGE performs as well as diversity sampling when that strategy does best, and as well as uncertainty sampling once those methods start outpacing CORESET. This suggests that BADGE is a good choice regardless of labeling budget.

Separately, we notice that diversity sampling only seems to work well when either the model has good architectural priors (inductive biases) built in, or when the data are easy to learn. Otherwise, penultimate layer representations are not meaningful, and diverse sampling can be deleterious. For this reason, CORESET often performs worse than random on sufficiently complex data when not using a convolutional network (Figure 3b ). That is, the diversity induced by unconditional random sampling can often yield a batch that better represents the data.

Even when batch size is large and the model has helpful inductive biases, the uncertainty information in BADGE can give it an advantage over pure diversity approaches (Figure 3c ). Comprehensive plots of this kind, spanning architecture, dataset, and batch size are in Appendix C.

Pairwise comparisons. We next show a comprehensive pairwise comparison of algorithms over all datasets (D), batch sizes (B), model architectures (A), and label budgets (L). From the learning curves, it can be observed that when label budgets are large enough, all algorithms eventually reach similar performance, making the comparison between them uninteresting in the large sample limit. For this reason, for each combination of (D, B, A), we select a set of labeling budgets L where learning is still progressing. We experimented with three different batch sizes and eleven dataset-architecture pairs, making the total number of (D, B, A) combinations 3 × 11 = 33. Specifically, we compute n 0 , the smallest number of labels where RAND's accuracy reaches 99% of its final accuracy, and choose label budget

L from M + 2 m-1 B : m ∈ [ log((n 0 -M )/B) ] .

The calculation of scores in the penalty matrix P follows the following protocol: For each (D, B, A, L) combination and each pair of algorithms (i, j), we have 5 test errors (one for each repeated run), e 1 i , . . . , e 5

i and e 1 j , . . . , e 5 j respectively. We compute the t-score as t = √ 5μ /σ, where 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1. The choice of the penalty value 1/n D,B,A is to ensure that every (D, B, A) combination is assigned equal influence in the aggregated matrix. Therefore, the largest entry of P is at most 33, the total number of (D, B, A) combinations.

Intuitively, each row i indicates the number of settings in which algorithm i beats other algorithms and each column j indicates the number of settings in which algorithm j is beaten by another algorithm.

The penalty matrix in Figure 4 summarizes all experiments, showing that BADGE generally outperforms baselines. Matrices grouped by batch size and architecture in Appendix D show a similar trend.

Cumulative distribution functions of normalized errors. For each (D, B, A, L) combination, we compute the average error for each algorithm i as ēi = 1 5 5 l=1 e l i . To ensure that the errors of these algorithms are on the same scale in all settings, we compute the normalized error of every algorithm i, defined as ne i = ēi /ē r , where r is the index of the RAND algorithm. By definition, the normalized errors of the RAND algorithm are identically 1 in all settings. Like with penalty matrices, for each (D, B, A) combination, we only consider a subset of L values from the set M + 2 m-1 B : m ∈ [ log((n 0 -M )/B) ] . We assign a weight proportional to 1/n D,B,A to each (D, B, A, L) combination, where there are n D,B,A different L values for this combination of (D, B, A). We then plot the cumulative distribution functions (CDFs) of the normalized errors of all algorithms: for a value of x, the y value is the total weight of settings where the algorithm has normalized error at most x; in general, an algorithm that has a higher CDF value has better performance.

We plot the generated CDFs in Figures 5, 22 and 23. We can see from Figure 5 that BADGE has the best overall performance. In addition, from Figures 22 and 23 in Appendix E, we can conclude that when batch size is small (100 or 1000) or when an MLP is used, both BADGE and MARG perform best. However, in the regime when the batch size is large (10000), MARG's performance degrades, while BADGE, ALBL and CORESET are the best performing approaches.

5. RELATED WORK:

Active learning is a been well-studied problem (Settles, 2010; Dasgupta, 2011; Hanneke, 2014) . There are two major strategies for active learning-representative sampling and uncertainty sampling. On the other hand, uncertainty sampling is based on a different principle-to select new samples that maximally reduce the uncertainty the algorithm has on the target classifier. In the context of linear classification, Tong and Koller (2001) ; Schohn and Cohn (2000) ; Tur et al. (2005) propose uncertainty sampling methods that query examples that lie closest to the current decision boundary. Some uncertainty sampling approaches have theoretical guarantees on statistical consistency (Hanneke, 2014; Balcan et al., 2006) . Such methods have also been recently generalized to deep learning. For instance, Gal et al. (2017) use Dropout as an approximation of the posterior of the model parameters, and develop information-based uncertainty reduction criteria; inspired by recent advances on adversarial examples generation, Ducoffe and Precioso (2018) use the distance between an example and one of its adversarial examples as an approximation of its distance to the current decision boundary, and uses it as the criterion of label queries. An ensemble of classifiers could also be used to effectively estimate uncertainty (Beluch et al., 2018) .

There are several existing approaches that support a hybrid of representative sampling and uncertainty sampling. For example, Baram et al. (2004) ; Hsu and Lin (2015) present meta-active learning algorithms that can combine the advantages of different active learning algorithms. Inspired by expected loss minimization, Huang et al. (2010) develop label query criteria that balances between the representativeness and informativeness of examples. Another method for this is Active Learning by Learning (Hsu and Lin, 2015) , which can select whether to exercise a diversity based algorithm or an uncertainty based algorithm at each round of training as a sequential decision process.

There is also a large body of literature on batch mode active learning, where the learner is asked to select a batch of samples within each round (Guo and Schuurmans, 2008; Wang and Ye, 2015; Chen and Krause; Wei et al., 2015; Kirsch et al., 2019) . In these works, batch selection is often formulated as an optimization problem with objectives based on (upper bounds of) average log-likelihood, average squared loss, etc.

A different query criterion based on expected gradient length (EGL) has been proposed in the as well (Settles et al., 2008) . In recent work, Huang et al. (2016) show that the EGL criterion is related to the T -optimality criterion in experimental design. They further demonstrate that the samples selected by EGL are very different from those by entropy-based uncertainty criterion. Zhang et al. (2017a) use the EGL criterion in active sentence and document classification with CNNs. These approaches differ most substantially from BADGE in that they do not take into account the diversity of the examples queried within each batch.

There is a wide array of theoretical articles that focus on the related problem of adaptive subsampling for fully-labeled datasets in regression settings (Han et al., 2016; Wang et al., 2018; Ting and Brochu, 2018) . Empirical studies of batch stochastic gradient descent also employ adaptive sampling to "emphasize" hard or representative examples (Zhang et al., 2017b; Chang et al., 2017) . These works aim at reducing computation costs or finding a better local optimal solution, as opposed to reducing label costs. Nevertheless, our work is inspired by their sampling criteria, which also emphasize samples that induce large updates to the model.

As mentioned earlier, our sampling criterion has resemblance to sampling from k-determinantal point processes (Kulesza and Taskar, 2011) . Note that in multiclass classification settings, our gradient-based embedding of an example can be viewed as the outer product of the original embedding in the penultimate layer and a probability score vector that encodes the uncertainty information on this example (see Section 3). In this view, the penultimate layer embedding characterizes the diversity of each example, whereas the probability score vector characterizes the quality of each example. The k-DPP is also a natural probabilistic tool for sampling that trades off between quality and diversity (See Kulesza et al., 2012, Section 3.1) Stephen Mussmann and Percy S Liang. Uncertainty sampling is preconditioned stochastic gradient descent on zero-one loss. In Neural Information Processing Systems, 2018.

A THE k-MEANS++ SEEDING ALGORITHM:

Here we briefly review the k-MEANS++ seeding algorithm by (Arthur and Vassilvitskii, 2007) . Its basic idea is to perform sequential sampling of k centers, where each new center is sampled from the ground set with probability proportional to the squared distance to its nearest center. It is shown in (Arthur and Vassilvitskii, 2007) that the set of centers returned is guaranteed to approximate the k-means objective function in expectation, thus ensuring diversity.

Algorithm 2 The k-MEANS++ seeding algorithm (Arthur and Vassilvitskii, 2007) Require:

Ground set G ⊂ R d , target size k. Ensure: Center set C of size k. C 1 ← {c 1 }, where c 1 is sampled uniformly at random from G. for t = 2, . . . , k: do Define D t (x) := min c∈Ct-1 x -c 2 . c t ← Sample x from G with probability Dt(x) 2 x∈G Dt(x) 2 . C t ← C t-1 ∪ {c t }. end for return C k .

B BADGE FOR BINARY LOGISTIC REGRESSION:

We consider instantiating BADGE for binary logistic regression, where Y = {-1, +1}. Given a linear classifier w, we define the predictive probability of w on x as p w (y|x, θ) = σ(yw • x), where σ(z) = 1 1+e -z is the sigmoid funciton.

Recall that ŷ = ŷ(x) is the hallucinated label:

ŷ(x) = +1, p w (+1|x, θ) > 1/2, -1, p w (+1|x, θ) ≤ 1/2.

The binary logistic loss of classifier w on example (x, y) is defined as: Suppose that BADGE only selects examples from region S w = {x : w • x = 0}, then as p w (+1|x, θ) = p w (-1|x, θ) = 1 2 , we have that for all x in S w , ĝx = s x • g x for some s x ∈ {±1}. This implies that, sampling from a DPP induced by ĝx 's is equivalent to sampling from a DPP induced by g x 's. It is noted in Mussmann and Liang (2018) that uncertainty sampling (i.e. sampling from D |Sw ) implicitly performs preconditioned stochastic gradient descent on the expected 0-1 loss. In addition, it has been shown that DPP sampling over gradients may reduce the variance of the mini-batch stochastic gradient updates (Zhang et al., 2017b) ; this suggests that BADGE, when restricted its sampling over low-margin regions (S w ), improves over uncertainty sampling by collecting examples that together induce lower-variance updates on the gradient direction of expected 0-1 loss.

(w, (x, y)) = ln(1 + exp(-yw • x)).

C ALL LEARNING CURVES:

We plot all learning curves (test accuracy as a function of the number of labeled example queried) in Figures 6 to 12. In addition, we zoom into regions of the learning curves that discriminates the performance of all algorithms in Figures 13 to 19 .

D PAIRWISE COMPARISONS OF ALGORITHMS:

In addition to Figure 4 in the main text, we also provide penalty matrices (Figures 20 and 21) , where the results are aggregated by conditioning on a fixed batch size (100, 1000 and 10000) or on a fixed neural network model (MLP, ResNet and VGG) . For each penalty matrix, the parenthesized number in its title is the The k-centers sampler finds points that are not as diverse or high-magnitude as other samplers. Notice also that k-MEANS++ tends to actually select samples that are both more diverse and higher-magnitude than a k-DPP, a potential pathology of the k-DPP's degree of stochastisity. Among all algorithms, CONF has the largest average norm of gradient embeddings within a batch; however, in OpenML #6, and the first few interations of SVHN, some batches have a log Gram determinant of -∞ (shown as gaps in the curve), which shows that CONF sometimes selects batches that are inferior in diversity.

many gaps in the CONF plot seem to correspond to situations in which CONF performs poorly in terms of accuracy (see Figure 13 for the corresponding learning curve). Both k-DPP and FF-k-CENTER (an algorithm that approximately minimizes k-center objective) select batches that have lower diversity than k-MEANS++ 

:

Because MNIST is a dataset that is extremely easy to classify, we only use MLPs, rather than convolutional networks, to better study the differences between active learning algorithms.

The OpenML datasets are from openml.org and are selected on two criteria: first, they have at least 10000 samples; second, neural networks have a significantly smaller test error rate when compared to linear models.

The definition of uncertainty (a lower bound on the gradient magnitude of the last layer) guarantees some update of parameters.

It optimizes for diversity as well as uncertainty, eliminating a failure mode of choosing many identical uncertain examples in a batch, and does so without requiring any hyperparameters.

The randomization associated with the k-MEANS++ initialization sampler implies that, even for adversarially constructed datasets, it eventually converges to a good solution.The combination of these properties appears to generate the robustness that we observe empirically.

Figures and Tables:

θ t+1 on S by minimizing E S [ CE (f (x; θ), y)]. 8: end for 9: return Final model θ T +1 .

Figure 1: Left and center: Learning curves for k-MEANS++ and k-DPP sampling with gradient embeddings for different scenarios. The performance of the two sampling approaches nearly perfectly overlaps. Right: A run time comparison (seconds) corresponding to the middle scenario. Each line is the average over five independent experiments. Standard errors are shown by shaded regions.

Figure2: A comparison of batch selection algorithms using our gradient embedding. Left and center: Plots showing the log determinant of the Gram matrix of the selected batch of gradient embeddings as learning progresses. Right: The average embedding magnitude (a measurement of predictive uncertainty) in the selected batch. The FF-k-CENTER sampler finds points that are not as diverse or high-magnitude as other samplers. Notice also that k-MEANS++ tends to actually select samples that are both more diverse and higher-magnitude than a k-DPP, a potential pathology of the k-DPP's degree of stochastisity. Standard errors are shown by shaded regions.

Figure 3: Active learning test accuracy versus the number of total labeled samples for a range of conditions. Standard errors are shown by shaded regions. models using cross-entropy loss and the Adam variant of SGD until training accuracy exceeds 99%. We use a learning rate of 0.001 for image data and of 0.0001 for non-image data. We avoid warm starting and retrain models from scratch every time new samples are queried (Ash and Adams, 2019). All experiments are repeated five times. No learning rate schedules or data augmentation are used. Baselines use implementations from the libact library (Yang et al., 2017). All models are trained in PyTorch (Paszke et al., 2017).

Figure 4: A pairwise penalty matrix over all experiments.

Representative sampling algorithms select batches of unlabeled examples that are representative of the unlabeled set to ask for labels. It is based on the intuition that the sets of representative examples chosen, once labeled, can act as a surrogate for the full dataset. Consequently, performing loss minimization on the surrogate suffices to ensure a low error with respect to the full dataset. In the context of deep learning,Sener and Savarese (2018);Geifman and El-Yaniv (2017) select representative examples based on core-set construction, a fundamental problem in computational geometry. Inspired by generative adversarial learning,Gissin and Shalev-Shwartz (2019) select samples that are maximally indistinguishable from the pool of unlabeled examples.

Figure 6: Full learning curves for OpenML #6 with MLP.

Figure 8: Full learning curves for OpenML #156 with MLP.

Figure 11: Full learning curves for MNIST with MLP.

Figure 13: Zoomed-in learning curves for OpenML #6 with MLP.

Figure 16: Zoomed-in learning curves for OpenML #184 with MLP.

Figure 18: Zoomed-in learning curves for MNIST with MLP.

Figure 25: Learning curves and running times for OpenML #6 with MLP.

Figure 26: Learning curves and running times for OpenML #155 with MLP.

Figure 27: Learning curves and running times for OpenML #156 with MLP.

Figure 30: Learning curves and running times for MNIST with MLP.

BADGE: Batch Active learning by Diverse Gradient Embeddings Require: Neural network f (x; θ), unlabeled pool of examples U , initial number of examples M , number of iterations T , number of examples in a batch B. 1: Labeled dataset S ← M examples drawn uniformly at random from U together with queried labels. 2: Train an initial model θ 1 on S by minimizing E S [ CE (f (x; θ), y)]. 3: for t = 1, 2, . . . , T : do

Table content: <table><tr><td>4:</td></tr></table>

). That is, to select a batch of k points

Table content: <table><tr><td/><td/><td/><td/><td/><td>k-DPP</td><td>k-means++</td><td/><td/></tr><tr><td>Accuracy</td><td>0.40 0.50 0.60 0.70 0.80 0.90</td><td>2000 4000 6000 8000 10000120001400016000 #Labels queried OpenML#6, MLP, Batch size: 100</td><td>Accuracy</td><td>0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90</td><td colspan="2">10000 SVHN, ResNet, Batch size: 1000 20000 30000 40000 #Labels queried</td><td>Time</td><td>0 1 2 3 4 5 6 7</td><td>10000 ×10 4 SVHN, ResNet, Batch size: 1000 20000 30000 #Labels queried 40000</td></tr></table>

. We remark that concurrent to our work,Bıyık et al. (2019)  develops k-DPP based active learning algorithms based on this principle by explicitly designing diversity and uncertainty measures. 6 DISCUSSION We have established that BADGE is empirically an effective deep active learning algorithm across different architectures and batch sizes, performing similar to or better than other active learning algorithms. A fundamental remaining question is: "Why?" While deep learning is notoriously difficult to analyze theoretically, there are several intuitively appealing properties of BADGE: Haw-Shiuan Chang, Erik Learned-Miller, and Andrew McCallum. Active bias: Training more accurate neural networks by emphasizing high variance samples. In Neural Information Processing Systems, 2017. Alex Kulesza, Ben Taskar, et al. Determinantal point processes for machine learning. Foundations and Trends in Machine Learning, 2012.

Table content: <table><tr><td>Erdem Bıyık, Kenneth Wang, Nima Anari, and Dorsa Sadigh. Batch active learning using determinantal point</td></tr><tr><td>processes. arXiv preprint, 2019.</td></tr></table>

Peer review (iclr2020):
This paper introduces an algorithm for active learning in deep neural networks named BADGE. It consists basically of two steps: (1) computing how uncertain the model is about the examples in the dataset (by looking at the gradients of the loss with respect to the parameters of the last layer of the network), and (2) sampling the examples that would maximize the diversity through k-means++. The empirical results show that BADGE is able to get the best of two worlds (sampling to maximize diversity/to minimize uncertainty), consistently outperforming other approaches in a wide-rage of classification tasks. This is a very well-written paper that seems to make a meaningful contribution to the field with a very good justification for the proposed method and with convincing empirical results. Active learning is not my main area of expertise so I can’t judge how novel the proposed idea is, but from an outsider’s perspective, this is a great paper. It is clear, it does a good job explaining the problem, the different approaches people have used to tackle the problem, and how it fits in this literature. Below I have a couple of (minor) comments and questions: 1. Out of curiosity, it seems that it is standard in the literature, but isn’t the assumption that one can go over the whole dataset, U, at each iteration of the active learning algorithm, limiting? It is not that cheap to go over large datasets (e.g., ImageNet). 2. MARG seems to often outperform the other baselines but it doesn’t have a reference attached to it (bullet points on page 5). Is this a case that a “trivial” baseline outperforms existing methods or is there a reference missing? 3. In some figures, such as Figure 2, there are shaded regions in the plots. It is not clear what they are though. Are they representing confidence intervals? Standard deviation? They are quite tight for a sample size of 5. 4. In the section “Pairwise comparisons” it reads “Algorithm i is said to beat algorithm j in this setting if z > 1.96, and similarly … z < -1.96”. It seems to me that the number 1.96 comes from the z-score table for 95% confidence. However, if that’s the case, it seems z should be much bigger in this context. With a sample-size of 5 (if this is still the sample size, maybe I missed something here), the normal assumptions do not hold and the t-score should’ve been used here. What did I miss? In terms of presentation, Proposition 1 seems to be a very interesting result. I would move it to the main paper instead of leaving it in the Appendix. I also think the paper would read better if it didn’t use references as nouns (e.g., “algorithm of (Derezinski, 2018)”). Finally, there’s also a typo on page 7 (Apppendx). --- >>> Update after rebuttal: I stand by my score after the rebuttal. This is a really strong paper in my opinion. I appreciate the fact that the authors took my feedback into consideration.