A Framework and Benchmark for Deep Batch Active Learning for Regression
Abstract
The acquisition of labels for supervised learning can be expensive. To improve the sample efficiency of neural network regression, we study active learning methods that adaptively select batches of unlabeled data for labeling. We present a framework for constructing such methods out of (networkdependent) base kernels, kernel transformations, and selection methods. Our framework encompasses many existing Bayesian methods based on Gaussian process approximations of neural networks as well as nonBayesian methods. Additionally, we propose to replace the commonly used lastlayer features with sketched finitewidth neural tangent kernels and to combine them with a novel clustering method. To evaluate different methods, we introduce an opensource benchmark consisting of 15 large tabular regression data sets. Our proposed method outperforms the stateoftheart on our benchmark, scales to large data sets, and works outofthebox without adjusting the network architecture or training code. We provide opensource code that includes efficient implementations of all kernels, kernel transformations, and selection methods, and can be used for reproducing our results.
Keywords: batch mode deep active learning, regression, tabular data, neural network, benchmark
1 Introduction
While supervised machine learning (ML) has been successfully applied to many different problems, these successes often rely on the availability of large data sets for the problem at hand. In cases where labeling data is expensive, it is important to reduce the required number of labels. Such a reduction could be achieved through various means: First, finding more sampleefficient supervised ML methods; second, applying data augmentation; third, leveraging information in unlabeled data via semisupervised learning; fourth, leveraging information from related problems through transfer learning, metalearning, or multitask learning; and finally, appropriately selecting which data to label. Active learning (AL) takes the latter approach by using a trained model to choose the next data point to label (settles_active_2009). The need to retrain after every new label prohibits parallelized labeling methods and can be far too expensive, especially for neural networks (NNs), which are often slow to train. This problem can be resolved by batch mode active learning (BMAL) methods, which select multiple data points for labeling at once. When the supervised ML method is a deep NN, this is known as batch mode deep active learning (BMDAL) (ren_survey_2021). Poolbased BMDAL refers to the setting where data points for labeling need to be chosen from a given finite set of points.
Supervised and unsupervised ML algorithms choose a model for given data. Multiple models can be compared on the same data using model selection techniques such as crossvalidation. Such a comparison increases the training cost, but not the (potentially much larger) cost of labeling data. In contrast to supervised learning, AL is about choosing the data itself, with the goal to reduce labeling cost. However, different AL algorithms may choose different samples, and hence a comparison of $N$ AL algorithms might increase labeling cost by a factor of up to $N$. Consequently, such a comparison is not sensible for applications where labeling is expensive. Instead, it is even more important to properly benchmark AL methods on tasks where labels are cheap to generate or a large number of labels is already available.
In the classification setting, NNs typically output uncertainties in the form of a vector of probabilities obtained through a softmax layer, while regression NNs typically output a scalar target without uncertainties. Therefore, many BMDAL algorithms only apply to one of the two settings. For classification, many BMDAL approaches have been proposed (ren_survey_2021), and there exist at least some standard benchmark data sets like CIFAR10 (krizhevsky_learning_2009) on which methods are usually evaluated. On the other hand, the regression setting has been studied less frequently, and no common benchmark has been established to the best of our knowledge, except for a specialized benchmark in drug discovery (mehrjou_genedisco_2021). We expect that the regression setting will gain popularity, not least due to the increasing interest in NNs for surrogate modeling (behler_perspective_2016; kutz_deep_2017; raissi_physicsinformed_2019; mehrjou_genedisco_2021; lavin_simulation_2021).
1.1 Contributions
In this paper, we investigate poolbased BMDAL methods for regression. Our experiments use fully connected NNs on tabular data sets, but the considered methods can be generalized to different types of data and NN architectures. We limit our study to methods that do not require to modify the network architecture and training, as these are particularly easy to use and a fair comparison to other methods is difficult. We also focus on methods that scale to large amounts of (unlabeled) data and large acquisition batch sizes. Our contributions can be summarized as follows:

(1)
We propose a framework for decomposing typical BM(D)AL algorithms into the choice of a kernel and a selection method. Here, the kernel can be constructed from a base kernel through a series of kernel transformations. The use of kernels as basic building blocks allows for an efficient yet flexible and composable implementation of our framework, which we include in our opensource code. We also discuss how (regression variants of) many popular BM(D)AL algorithms can be represented in this framework and how they can efficiently be implemented. This gives us a variety of options for base kernels, kernel transformations, and selection methods to combine. Our framework encompasses both Bayesian methods based on Gaussian Processes and Laplace approximations as well as geometric methods.

(2)
We discuss some alternative options to the ones arising from popular BM(D)AL algorithms: We introduce a novel selection method called LCMD; and we propose to combine the finitewidth neural tangent kernel (NTK, jacot_neural_2018) as a base kernel with sketching for efficient computation.

(3)
We introduce an opensource benchmark for BMDAL involving 15 large tabular regression data sets. Using this benchmark, we compare different selection methods and evaluate the influence of the kernel, the acquisition batch size, and the target metric.
Our newly proposed selection method, LCMD, improves the stateoftheart in our benchmark in terms of RMSE and MAE, while still exhibiting good performance for the maximum error. The NTK base kernel improves the benchmark accuracy for all selection methods, and the proposed sketching method can preserve this accuracy while leading to significant time gains. Figure 1 shows a comparison of our novel BMDAL algorithm against popular BMDAL algorithms from the literature, which are all implemented in our framework. The code for our framework and benchmark is based on PyTorch (paszke_pytorch_2019) and is publicly available at +rCl+x* https://github.com/dholzmueller/bmdal_reg and will be archived together with the generated data at https://doi.org/10.18419/darus3394.
The rest of this paper is structured as follows: In Section 2, we introduce the basic problem setting of BMDAL for tabular regression with fullyconnected NNs and introduce our framework for the construction of BMDAL algorithms. We discuss related work in Section 3. We then introduce options to build kernels from base kernels and kernel transformations in Section 4. LABEL:sec:sel_methods discusses various iterative kernelbased selection methods. Our experiments in LABEL:sec:bmdal:experiments provide insights into the performance of different combinations of kernels and selection methods. Finally, we discuss limitations and open questions in LABEL:sec:conclusion. More details on the presented methods and experimental results are provided in the Appendix, whose structure is outlined in LABEL:sec:appendix:overview.
2 Problem Setting
In this section, we outline the problem of BMDAL for regression with fullyconnected NNs. We first introduce the regression objective and fullyconnected NNs. Subsequently, we introduce the basic setup of poolbased BMDAL as well as our proposed framework.
2.1 Regression with FullyConnected Neural Networks
We consider multivariate regression, where the goal is to learn a function $f:{\mathbb{R}}^{d}\to \mathbb{R}$ from data $(\bm{x},y)\in {\mathcal{D}}_{\mathrm{train}}\subseteq {\mathbb{R}}^{d}\times \mathbb{R}$. In the case of NNs, we consider a parameterized function family ${({f}_{\bm{\theta}})}_{\bm{\theta}\in {\mathbb{R}}^{m}}$ and try to minimize the mean squared loss on training data ${\mathcal{D}}_{\mathrm{train}}$ with ${N}_{\mathrm{train}}$ samples: +rCl+x* L(θ) & = 1Ntrain ∑_(x, y) ∈D_train (y  f_θ(x))^2 . We refer to the inputs and labels in ${\mathcal{D}}_{\mathrm{train}}$ as ${\mathcal{X}}_{\mathrm{train}}$ and ${\mathcal{Y}}_{\mathrm{train}}$, respectively. Corresponding data sets are often referred to as tabular data or structured data. This is in contrast to data with a known spatiotemporal relationship between the input features, such as image or timeseries data, where specialized NN architectures such as CNNs are more successful.
For our derivations and experiments, we consider an $L$layer fullyconnected NN ${f}_{\bm{\theta}}:{\mathbb{R}}^{d}\to \mathbb{R}$ with parameter vector $\bm{\theta}=({\bm{W}}^{(1)},{\bm{b}}^{(1)},\mathrm{\dots},{\bm{W}}^{(L)},{\bm{b}}^{(L)})$ and input size ${d}_{0}=d$, hidden layer sizes ${d}_{1},\mathrm{\dots},{d}_{L1}$, and output size ${d}_{L}=1$. The value ${\bm{z}}_{i}^{(L)}={f}_{\bm{\theta}}({\bm{x}}_{i}^{(0)})$ of the NN on the $i$th input ${\bm{x}}_{i}^{(0)}\in {\mathbb{R}}^{{d}_{0}}$ is defined recursively by
$${\bm{x}}_{i}^{(l+1)}=\phi ({\bm{z}}_{i}^{(l+1)})\in {\mathbb{R}}^{{d}_{l+1}},{\bm{z}}_{i}^{(l+1)}=\frac{{\sigma}_{w}}{\sqrt{{d}_{l}}}{\bm{W}}^{(l+1)}{\bm{x}}_{i}^{(l)}+{\sigma}_{b}{\bm{b}}^{(l+1)}\in {\mathbb{R}}^{{d}_{l+1}}.$$  (1) 
Here, the activation function $\phi :\mathbb{R}\to \mathbb{R}$ is applied elementwise and ${\sigma}_{w},{\sigma}_{b}>0$ are constant factors. In our experiments, the weight matrices are initialized with independent standard normal entries and the biases are initialized to zero. The factors ${\sigma}_{w}/\sqrt{{d}_{l}}$ and ${\sigma}_{b}$ stem from the neural tangent parametrization (NTP) (jacot_neural_2018; lee_wide_2019), which is theoretically motivated to define infinitewidth limits of NNs and is also used in our applications. However, our derivations apply analogously to NNs without these factors. When considering different NN types such as CNNs, it is possible to apply our derivations only to the fullyconnected part of the NN or to extend them to other layers as well.
2.2 Batch Mode Active Learning
In a single BMAL step, a BMAL algorithm selects a batch ${\mathcal{X}}_{\mathrm{batch}}\subseteq {\mathbb{R}}^{d}$ with a given size ${N}_{\mathrm{batch}}\in \mathbb{N}$. Subsequently, this batch is labeled and added to the training set. Here, we consider poolbased BMAL, where ${\mathcal{X}}_{\mathrm{batch}}$ is to be selected from a given finite pool set ${\mathcal{X}}_{\mathrm{pool}}$ of candidates. Other AL paradigms include membership query AL, where data points for labeling can be chosen freely, or streambased AL, where data points arrive sequentially and must be immediately labeled or discarded. The pool set can potentially contain information about which regions of the input space are more important than others, especially if it is drawn from the same distribution as the test set. Moreover, poolbased BMAL allows for efficient benchmarking of BMAL methods on labeled data sets by reserving a large portion of the data set for the pool set, rendering the labeling part trivial.
When comparing and evaluating BMDAL methods, we are mainly interested in the following desirable properties:

(P1)
The method should improve the sample efficiency of the underlying NN, even for large acquisition batch sizes ${N}_{\mathrm{batch}}$ and large pool set sizes ${N}_{\mathrm{pool}}$, with respect to the downstream application, which may or may not involve the same input distribution as training and pool data.

(P2)
The method should scale to large pool sets, training sets, and batch sizes, in terms of both computation time and memory consumption.

(P3)
The method should be applicable to a wide variety of NN architectures and training methods, such that it can be applied to different use cases.

(P4)
The method should not require modifying the NN architecture and training method, for example by requiring to introduce Dropout, such that practitioners do not have to worry whether employing the method diminishes the accuracy of their trained NN.

(P5)
The method should not require training multiple NNs for a single batch selection since this would deteriorate its runtime efficiency.^{1}^{1}1Technically, requiring multiple trained NNs would not be detrimental if it facilitated reaching the same accuracy with correspondingly larger ${N}_{\mathrm{batch}}$.

(P6)
The method should not require tuning hyperparameters on the downstream application since this would require labeling samples selected with suboptimal hyperparameters.
Property (P1) is central to motivate the use of BMDAL over random sampling of the data and is evaluated for our framework in detail in LABEL:sec:bmdal:experiments and LABEL:sec:appendix:experiments. We only evaluate methods with property (P2) since our benchmark involves large data sets. All methods considered here satisfy (P3) to a large extent. Indeed, although efficient computations are only studied for fullyconnected layers here, the considered methods can be simply applied to the fullyconnected part of a larger NN. All considered methods satisfy (P4), which also facilitates fair comparison in a benchmark. All our methods satisfy (P5), although our methods can incorporate ensembles of NNs. Although some of the considered methods have hyperparameters, we fix them to reasonable values independent of the data set in our experiments, such that (P6) is satisfied.
Algorithm 1 shows how BMDAL algorithms satisfying (P4) and (P5) can be used in a loop with training and labeling.
wu_poolbased_2018 formulates three criteria by which BMAL algorithms may select batch samples in order to improve the sample efficiency of a learning method:

(INF)
The algorithm should favor inputs that are informative to the model. These could, for example, be those inputs where the model is most uncertain about the label.

(DIV)
The algorithm should ensure that the batch contains diverse samples, i.e., samples in the batch should be sufficiently different from each other.

(REP)
The algorithm should ensure representativity of the resulting training set, i.e., it should focus more strongly on regions where the pool data distribution has high density.
Note that (REP) might not be desirable if one expects a significant distribution shift between pool and test data. A challenge in trying to adapt nonbatch AL methods to the batch setting is that some nonbatch AL methods expect to immediately receive a label for every selected sample. It is usually possible to circumvent this by selecting the ${N}_{\mathrm{batch}}$ samples with the largest acquisition function scores at once, but this does not enforce (DIV) or (REP).
We propose a framework for assembling BMDAL algorithms that is shown in Algorithm 2 and consists of three components: First, a base kernel $k$ needs to be chosen that should serve as a proxy for the trained network ${f}_{\bm{\theta}}$. Second, the kernel can be transformed using various transformations. These transformations can, for example, make the kernel represent posteriors or improve its evaluation efficiency. Third, a selection method is invoked that uses the transformed kernel as a measure of similarity between inputs. When using Gaussian Process regression with a given kernel $k$ as a supervised learning method instead of an NN, the base kernel could simply be chosen as $k$. Note that Select does not observe the training labels directly, however, in the NN setting, these can be implicitly incorporated through kernels that depend on the trained NN.
Example 1.
In Algorithm 2, the base kernel $k$ could be of the form $k(\mathbf{x},\stackrel{~}{\mathbf{x}})=\u27e8\varphi (\mathbf{x}),\varphi (\stackrel{~}{\mathbf{x}})\u27e9$, where $\varphi $ represents the trained NN without the last layer. When interpreting $k$ as the kernel of a Gaussian process, TransformKernel could then compute a transformed kernel $\stackrel{~}{k}$ that represents the posterior predictive uncertainty after observing the training data. Finally, Select could then choose the ${N}_{\mathrm{batch}}$ points $\mathbf{x}\in {\mathcal{X}}_{\mathrm{pool}}$ with the largest uncertainty $\stackrel{~}{k}(\mathbf{x},\mathbf{x})$.
From a Bayesian perspective, our choice of kernel and kernel transformations can correspond to inference in a Bayesian approximation, as we discuss in LABEL:sec:appendix:posterior, while the selection method can correspond to the optimization of an acquisition function. However, in our framework, the same “Bayesian” kernels can be used together with nonBayesian selection methods and vice versa.
3 Related Work
The field of active learning, also known as query learning or sequential (optimal) experimental design (fedorov_theory_1972; chaloner_bayesian_1995), has a long history dating back at least to the beginning of the 20th century (smith_standard_1918). For an overview of the AL and BMDAL literature, we refer to settles_active_2009; kumar_active_2020; ren_survey_2021; weng_learning_2022.
We first review work relevant to the kernels in our framework, before discussing work more relevant to selection methods, and finally, data sets. More literature related to specific methods is also discussed in Section 4 and LABEL:sec:sel_methods.
3.1 Uncertainty Measures and Kernel Approximations
A popular class of BMDAL methods is given by Bayesian methods since the Bayesian framework naturally provides uncertainties that can be used to assess informativeness. These methods require to use Bayesian NNs, or in other words, the calculation of an approximate posterior distribution over NN parameters. A simple option is to perform Bayesian inference only over the last layer of the NN (lazarogredilla_marginalized_2010; snoek_scalable_2015; ober_benchmarking_2019; kristiadi_being_2020). The Laplace approximation (laplace_memoire_1774; mackay_bayesian_1992) can provide a local posterior distribution around a local optimum of the loss landscape via a secondorder Taylor approximation. An alternative local approach based on SGD iterates is called SWAG (maddox_simple_2019). Ensembles of NNs (hansen_neural_1990; lakshminarayanan_simple_2017) can be interpreted as a simple multimodal posterior approximation and can be combined with local approximations to yield mixtures of Laplace approximations (eschenhagen_mixtures_2021) or MultiSWAG (wilson_bayesian_2020). Monte Carlo (MC) Dropout (gal_dropout_2016) is an option to obtain ensemble predictions from a single NN, although it requires training with Dropout (srivastava_dropout_2014). Regarding uncertainty approximations, our considered algorithms are mainly related to exact lastlayer methods and the Laplace approximation, as these do not require to modify the training process. daxberger_laplace_2021 give an overview of various methods to compute (approximate) Laplace approximations.
Some recent approaches also build on the neural tangent kernel (NTK) introduced by jacot_neural_2018. khan_approximate_2019 show that certain Laplace approximations are related to the finitewidth NTK. wang_deep_2022 and mohamadi_making_2022 propose the use of finitewidth NTKs for DAL for classification. wang_neural_2021 use the finitewidth NTK at initialization for the streaming setting of DAL for classification and theoretically analyze the resulting method. aljundi_identifying_2022 use a kernel related to the finitewidth NTK for DAL. shoham_experimental_2023, borsos_coresets_2020 and borsos_semisupervised_2021 use infinitewidth NTKs for BMDAL and related tasks. han_random_2021 propose sketching for infinitewidth NTKs and also evaluate it for DAL. In contrast to these papers, we propose sketching for finitewidth NTKs and allow combining the resulting kernel with different selection methods.
3.2 Selection Methods
Besides a Bayesian NN model, a Bayesian BMDAL method needs to specify an acquisition function that decides how to prioritize the pool samples. Many simple acquisition functions for quantifying uncertainty have been proposed (kumar_active_2020). Selecting the next sample where an ensemble disagrees most is known as QuerybyCommittee (QbC) (seung_query_1992). krogh_neural_1994 employed QbC for DAL for regression. A more recent investigation of QbC to DAL for classification is performed by beluch_power_2018. pop_deep_2018 combine ensembles with MC Dropout. tsymbalov_dropoutbased_2018 use the predictive variance obtained by MC Dropout for DAL for regression. zaverkin_exploration_2021 use lastlayerbased uncertainty in DAL for regression on atomistic data. Unlike the other approaches mentioned before, the approach by zaverkin_exploration_2021 can be applied to a single NN trained without Dropout.
Many uncertaintybased acquisition functions do not distinguish between epistemic uncertainty, i.e., lack of knowledge about the true functional relationship, and aleatoric uncertainty, i.e., inherent uncertainty due to label noise. houlsby_bayesian_2011 propose the BALD acquisition function, which aims to quantify epistemic uncertainty only. gal_deep_2017 apply BALD and other acquisition functions to BMDAL for classification with MC Dropout. To enforce diversity of the selected batch, kirsch_batchbald_2019 propose BatchBALD and evaluate it on classification problems with MC Dropout. ash_gone_2021 propose Bait, which also incorporates representativity through Fisher information based on lastlayer features, and is evaluated on classification and regression data sets.
Another approach towards BMDAL is to find coresets that represent ${\mathcal{X}}_{\mathrm{pool}}$ in a geometric sense. sener_active_2018 and geifman_deep_2017 propose algorithms to cover the pool set with ${\mathcal{X}}_{\mathrm{batch}}\cup {\mathcal{X}}_{\mathrm{train}}$ in a lastlayer feature space. ash_deep_2019 propose BADGE, which applies clustering in a similar feature space, but includes uncertainty via gradients through the softmax layer for classification. ACSFW (pinsler_bayesian_2019) can be seen as a hybrid between coreset and Bayesian approaches, trying to approximate the expected logposterior on the pool set with a coreset, also using lastlayerbased Bayesian approximations. Besides Bait, ACSFW is one of the few approaches that is designed and evaluated for both classification and regression. Our newly proposed selection method LCMD is clusteringbased like the kmeans++ method used in BADGE, but deterministic.
Many more approaches towards BMDAL exist, and they can be combined with additional steps such as prereduction of ${\mathcal{X}}_{\mathrm{pool}}$ (ghorbani_data_2022) or reweighting of selected instances (farquhar_statistical_2021). Most of these BMDAL methods are geared towards classification, and for a broader overview, we refer to ren_survey_2021. For (image) regression, ranganathan_deep_2020 introduce an auxiliary loss term on the pool set, which they use to perform DAL. It is unclear, though, to which extent their success is explained by implicitly performing semisupervised learning.
Since we frequently consider Gaussian Processes (GPs) as approximations to Bayesian NNs in this paper, our work is also related to BMAL for GPs, although in our case the GPs are only used for selecting ${\mathcal{X}}_{\mathrm{batch}}$ and not for the regression itself. Popular BMAL methods for GPs have been suggested for example by seo_gaussian_2000 and krause_nearoptimal_2008.
3.3 Data Sets
In terms of benchmark data sets for BM(D)AL for regression, tsymbalov_dropoutbased_2018 use seven large tabular data sets, some of which we have included in our benchmark, cf. LABEL:sec:appendix:data_sets. pinsler_bayesian_2019 use only one large tabular regression data set. ash_gone_2021 use a small tabular regression data set and three image regression data sets, two of which are converted classification data sets. wu_poolbased_2018 benchmarks exclusively on small tabular data sets. zaverkin_exploration_2021 work with atomistic data sets, which require specialized NN architectures and longer training times, and are therefore less wellsuited for a largescale benchmark. ranganathan_deep_2020 use CNNs on five image regression data sets. Recently, a benchmark for BMDAL for drug discovery has been proposed, which uses four counterfactual regression data sets (mehrjou_genedisco_2021). In this paper, we provide an opensource benchmark on 15 large tabular data sets, which includes more baselines and evaluation criteria than evaluations in previous papers.
4 Kernels
In this section, we discuss a variety of base kernels yielding various approximations to a trained NN ${f}_{{\bm{\theta}}_{T}}$, as well as different kernel transformations that yield new kernels with different meanings or simply improved efficiency. In the following, we consider positive semidefinite kernels $k:{\mathbb{R}}^{d}\times {\mathbb{R}}^{d}\to \mathbb{R}$. For an introduction to kernels, we refer to the literature (e.g. steinwart_support_2008). The kernels considered here can usually be represented by a feature map $\varphi $ with finitedimensional feature space, that is, $\varphi :{\mathbb{R}}^{d}\to {\mathbb{R}}^{{d}_{\mathrm{feat}}}$ with $k({\bm{x}}_{i},{\bm{x}}_{j})=\u27e8\varphi ({\bm{x}}_{i}),\varphi ({\bm{x}}_{j})\u27e9$. For a sequence $\mathcal{X}=({\bm{x}}_{1},\mathrm{\dots},{\bm{x}}_{n})$ of inputs, which we sometimes treat like a set $\mathcal{X}\subseteq {\mathbb{R}}^{d}$ by a slight abuse of notation, we define the corresponding feature matrix
$$\varphi (\mathcal{X})=\left(\begin{array}{c}\varphi {({\bm{x}}_{1})}^{\top}\\ \mathrm{\vdots}\\ \varphi {({\bm{x}}_{n})}^{\top}\end{array}\right)\in {\mathbb{R}}^{n\times {d}_{\mathrm{feat}}}$$  (2) 
and kernel matrices $k(\bm{x},\mathcal{X})={(k(\bm{x},{\bm{x}}_{i}))}_{i}\in {\mathbb{R}}^{1\times n}$, $k(\mathcal{X},\mathcal{X})={(k({\bm{x}}_{i},{\bm{x}}_{j}))}_{ij}\in {\mathbb{R}}^{n\times n}$, $k(\mathcal{X},\bm{x})={(k({\bm{x}}_{i},\bm{x}))}_{i}\in {\mathbb{R}}^{n\times 1}$.
4.1 Base Kernels
We first discuss various options for creating base kernels that induce some notion of similarity on the training and pool inputs. An overview of these base kernels can be found in Table 1.
Base kernel  Symbol  Feature map  Feature space dimension ${d}_{\mathrm{feat}}$ 

Linear  ${k}_{\mathrm{lin}}$  ${\varphi}_{\mathrm{lin}}(\bm{x})=\bm{x}$  $d$ 
NNGP  ${k}_{\mathrm{nngp}}$  not explicitly defined  $\mathrm{\infty}$ 
full gradient  ${k}_{\mathrm{grad}}$  ${\varphi}_{\mathrm{grad}}(\bm{x})={\nabla}_{\bm{\theta}}{f}_{{\bm{\theta}}_{T}}(\bm{x})$  ${\sum}_{l=1}^{L}{d}_{l}({d}_{l1}+1)$ 
lastlayer  ${k}_{\mathrm{ll}}$  ${\varphi}_{\mathrm{ll}}(\bm{x})={\nabla}_{{\stackrel{~}{\bm{W}}}^{(L)}}{f}_{{\bm{\theta}}_{T}}(\bm{x})$  ${d}_{L}({d}_{L1}+1)$ 
4.1.1 Linear Kernel
A very simple baseline for other base kernels is the linear kernel ${k}_{\mathrm{lin}}(\bm{x},\stackrel{~}{\bm{x}})=\u27e8\bm{x},\stackrel{~}{\bm{x}}\u27e9$, corresponding to the identity feature map +rCl+x* ϕ_lin(x) ≔x . It is usually very fast to evaluate but does not represent the behavior of an NN well. Moreover, its feature space dimension depends on the input dimension, and hence may not be suited for selection methods that depend on having highdimensional representations of the data. A more accurate representation of the behavior of an NN is given by the next kernel:
4.1.2 Full gradient Kernel
If ${\bm{\theta}}_{T}$ is the parameter vector of the trained NN, we define +rCl+x* ϕ_grad(x) ≔∇_θ f_θ_T(x) . This is motivated as follows: A linearization of the NN with respect to its parameters around ${\bm{\theta}}_{T}$ is given by the firstorder Taylor expansion
$${f}_{\bm{\theta}}(\bm{x})\approx {\stackrel{~}{f}}_{\bm{\theta}}(\bm{x})\u2254{f}_{{\bm{\theta}}_{T}}(\bm{x})+\u27e8{\varphi}_{\mathrm{grad}}(\bm{x}),\bm{\theta}{\bm{\theta}}_{T}\u27e9.$$  (3) 
If we were to resume training from the parameters ${\bm{\theta}}_{T}$ after labeling the next batch ${\mathcal{X}}_{\mathrm{batch}}$, the result of training on the extended data could hence be approximated by the function ${f}_{{\bm{\theta}}_{T}}+{f}_{\mathrm{\Delta}}$, where ${f}_{\mathrm{\Delta}}$ is the result of linear regression with feature map ${\varphi}_{\mathrm{grad}}$ on the data residuals $({\bm{x}}_{i},{y}_{i}{f}_{{\bm{\theta}}_{T}}({\bm{x}}_{i}))$ for $({\bm{x}}_{i},{y}_{i})\in {\mathcal{D}}_{\mathrm{train}}\cup {\mathcal{D}}_{\mathrm{batch}}$.
The kernel ${k}_{\mathrm{grad}}$ is also known as the (empirical / finitewidth) neural tangent kernel (NTK). It depends on the linearization point ${\bm{\theta}}_{T}$, but can for certain training settings converge to a fixed kernel as the hidden layer widths go to infinity (jacot_neural_2018; lee_wide_2019; arora_exact_2019). In practical settings, however, it has been observed that ${k}_{\mathrm{grad}}$ often “improves” during training (fort_deep_2020; long_properties_2021; shan_theory_2021; atanasov_neural_2021), especially in the beginning of training. This agrees with our observations in LABEL:sec:bmdal:experiments and suggests that shorter training might already yield a gradient kernel that allows selecting a good ${\mathcal{X}}_{\mathrm{batch}}$. Indeed, coleman_selection_2019 found that shorter training and even smaller models can already be sufficient to select good batches for BMDAL for classification.
For fullyconnected layers, we will now show that the feature map ${\varphi}_{\mathrm{grad}}$ has an additional product structure that can be exploited to reduce the runtime and memory consumption of a kernel evaluation. For notational simplicity, we rewrite Eq. (1) as
+rCl+x*
z_i^(l+1) & = ~W^(l+1) ~x_i^(l),
~W^(l+1) ≔ (W(l+1)b(l+1)) ∈R^d_l+1 ×(d_l + 1), ~x_i^(l) ≔(σwdlxi(l)σb) ∈R^d_l + 1 ,
with parameters $\bm{\theta}=({\stackrel{~}{\bm{W}}}^{(1)},\mathrm{\dots},{\stackrel{~}{\bm{W}}}^{(L)})$. Using the notation from Eq. (4.1.2), we can write
$${\varphi}_{\mathrm{grad}}({\bm{x}}_{i}^{(0)})=(\frac{\mathrm{d}{\bm{z}}_{i}^{(L)}}{\mathrm{d}{\stackrel{~}{\bm{W}}}^{(1)}},\mathrm{\dots},\frac{\mathrm{d}{\bm{z}}_{i}^{(L)}}{\mathrm{d}{\stackrel{~}{\bm{W}}}^{(L)}})=(\frac{\mathrm{d}{\bm{z}}_{i}^{(L)}}{\mathrm{d}{\bm{z}}_{i}^{(1)}}{({\stackrel{~}{\bm{x}}}_{i}^{(0)})}^{\top},\mathrm{\dots},\frac{\mathrm{d}{\bm{z}}_{i}^{(L)}}{\mathrm{d}{\bm{z}}_{i}^{(L)}}{({\stackrel{~}{\bm{x}}}_{i}^{(L1)})}^{\top}).$$  (4) 
For a kernel evaluation, the factorization of the weight matrix derivatives can be exploited via
+rCl+x*
k_grad(x_i^(0), x_j^(0)) & = ∑_l=1^L ⟨dzi(L)dzi(l) (~x_i^(l1))^⊤, dzj(L)dzj(l) (~x_j^(l1))^⊤⟩_F
= ∑_l=1^L ⏟⟨~x_i^(l1), ~x_j^(l1)⟩_≕k^(l)_in(x_i^(0), x_j^(0)) ⋅⏟⟨dzi(L)dzi(l), dzj(L)dzj(l)⟩_≕k^(l)_out(x_i^(0), x_j^(0)) ,
since ${\u27e8\bm{a}{\bm{b}}^{\top},\bm{c}{\bm{d}}^{\top}\u27e9}_{F}=\mathrm{tr}(\bm{b}{\bm{a}}^{\top}\bm{c}{\bm{d}}^{\top})=\mathrm{tr}({\bm{a}}^{\top}\bm{c}{\bm{d}}^{\top}\bm{b})={\bm{a}}^{\top}\bm{c}{\bm{d}}^{\top}\bm{b}=\u27e8\bm{a},\bm{c}\u27e9\cdot \u27e8\bm{b},\bm{d}\u27e9$. This means that ${k}_{\mathrm{grad}}$ can be decomposed into sums of products of kernels with smaller feature space dimension:^{2}^{2}2For the sketching method defined later, we may exploit that ${k}_{\mathrm{out}}^{(L)}(\bm{x},\stackrel{~}{\bm{x}})=1$, hence ${k}_{\mathrm{out}}^{(L)}$ can be omitted.
$${k}_{\mathrm{grad}}(\bm{x},\stackrel{~}{\bm{x}})=\sum _{l=1}^{L}{k}_{\mathrm{in}}^{(l)}(\bm{x},\stackrel{~}{\bm{x}})\cdot {k}_{\mathrm{out}}^{(l)}(\bm{x},\stackrel{~}{\bm{x}})$$  (5) 
When using Eq. (4.1.2), the full gradients $\frac{\mathrm{d}{\bm{z}}_{i}^{(L)}}{\mathrm{d}{\stackrel{~}{\bm{W}}}^{(l)}}$ never have to be computed or stored explicitly. If $\frac{\mathrm{d}{\bm{z}}_{i}^{(L)}}{\mathrm{d}{\bm{z}}_{i}^{(l)}}$ and ${\stackrel{~}{\bm{x}}}_{i}^{(l1)}$ are already computed and the hidden layers contain $m={d}_{1}=\mathrm{\dots}={d}_{L1}$ neurons each, Eq. (4.1.2) reduces the runtime complexity of a kernel evaluation from $\mathrm{\Theta}({m}^{2}L)$ to $\mathrm{\Theta}(mL)$, and similarly for the memory complexity of precomputed features. In LABEL:sec:kernel_transformations:rp, we will see how to further accelerate this kernel computation using sketching. Efficient computations of ${k}_{\mathrm{grad}}$ for more general types of layers and multiple output neurons are discussed by novak_fast_2022.
Since ${k}_{\mathrm{grad}}$ consists of gradient contributions from multiple layers, it is potentially important that the magnitudes of the gradients in different layers are balanced. We achieve this, at least at initialization, through the use of the neural tangent parameterization (jacot_neural_2018). For other NN architectures, however, it might be desirable to reweight gradient magnitudes from different layers to improve the results obtained with ${k}_{\mathrm{grad}}$.
4.1.3 Lastlayer Kernel
A simple and rough approximation to the fullgradient kernel is given by only considering the gradient with respect to the parameters in the last layer: +rCl+x* ϕ_ll(x) ≔∇_~W^(L) f_θ_T(x) . From Eq. (4), it is evident that in the singleoutput regression case that we are considering, ${\varphi}_{\mathrm{ll}}({\bm{x}}_{i}^{(0)})$ is simply the input ${\stackrel{~}{\bm{x}}}_{i}^{(L1)}$ to the last layer of the NN. The latter formulation can also be used in the multioutput setting, and versions of it (with ${\bm{x}}_{i}^{(L1)}$ instead of ${\stackrel{~}{\bm{x}}}_{i}^{(L1)}$) have been frequently used for BMDAL (sener_active_2018; geifman_deep_2017; pinsler_bayesian_2019; ash_deep_2019; zaverkin_exploration_2021; ash_gone_2021).
4.1.4 Infinitewidth NNGP
It has been shown that as the widths ${d}_{1},\mathrm{\dots},{d}_{L1}$ of the hidden NN layers converge to infinity, the distribution of the initial function ${f}_{{\bm{\theta}}_{0}}$ converges to a Gaussian Process with mean zero and a covariance kernel ${k}_{\mathrm{nngp}}$ called the neural network Gaussian process (NNGP) kernel (neal_priors_1994; lee_deep_2018; matthews_gaussian_2018). This kernel depends on the network depth, the used activation function, and details such as the initialization variance and scaling factors like ${\sigma}_{w}$. In our experiments, we use the NNGP kernel corresponding to the employed NN setup, for which the formulas are given in LABEL:sec:appendix:nngp.
As mentioned above, there exists an infinitewidth limit of ${k}_{\mathrm{grad}}$, the socalled neural tangent kernel (jacot_neural_2018). We decided to omit it from our experiments in LABEL:sec:appendix:experiments after preliminary experiments showed similarly bad performance as for the NNGP.
4.2 Kernel Transformations
The base kernels introduced in Section 4.1 are constructed such that kernel regression with these kernels serves as a proxy for regression with the corresponding NN. By using kernels, we can model interactions $k(\bm{x},\stackrel{~}{\bm{x}})$ between two inputs, which is crucial to incorporate diversity (DIV) into the selection methods. However, this is not always sufficient to apply a selection method. For example, sometimes we want the kernel to represent uncertainties of the NN after observing the data, or we want to reduce the feature space dimension to render selection more efficient. Therefore, we introduce various ways to transform kernels in this section. When applying transformations ${T}_{1},\mathrm{\dots},{T}_{n}$ in this order to a base kernel ${k}_{\mathrm{base}}$, we denote the transformed kernel by ${k}_{\mathrm{base}\to {T}_{1}\to {T}_{2}\to \mathrm{\dots}\to {T}_{n}}$. Of course, we can only cover selected transformations relevant to our applications, and other transformations such as sums or products of kernels are possible as well.
Notation  Description  ${d}_{\mathrm{pre}}$  ${d}_{\mathrm{post}}$  Configurable ${\sigma}^{2}$? 

${k}_{\to \mathrm{scale}(\mathcal{X})}$  Rescale kernel to normalize mean $k(\bm{x},\bm{x})$ on $\mathcal{X}$  any  ${d}_{\mathrm{pre}}$  no 
${k}_{\to \mathrm{post}(\mathcal{X},{\sigma}^{2})}$  GP posterior covariance after observing $\mathcal{X}$  any  ${d}_{\mathrm{pre}}$  yes 
${k}_{\to \mathcal{X}}$  Short for ${k}_{\to \mathrm{scale}(\mathcal{X})\to \mathrm{post}(\mathcal{X},{\sigma}^{2})}$  any  ${d}_{\mathrm{pre}}$  yes 
${k}_{\to \mathrm{sketch}(p)}$  Sketching with $p$ features  $$  $p$  no 
${k}_{\to \mathrm{ens}({N}_{\mathrm{ens}})}$  Sum of kernels for ${N}_{\mathrm{ens}}$ ensembled networks  any  ${N}_{\mathrm{ens}}{d}_{\mathrm{pre}}$  no 
${k}_{\to \mathrm{acs}\mathrm{grad}}$  Gradientbased kernel from pinsler_bayesian_2019  any  ${d}_{\mathrm{pre}}^{2}$  yes 
${k}_{\to \mathrm{acs}\mathrm{rf}(p)}$  Kernel from pinsler_bayesian_2019 with $p$ random features  $$  $p$  yes 
${k}_{\to \mathrm{acs}\mathrm{rf}\mathrm{hyper}(p)}$  Kernel from pinsler_bayesian_2019 with $p$ random features and hyperprior on ${\sigma}^{2}$  $$  $p$  no 
4.2.1 Scaling
For a given kernel $k$ with feature map $\varphi $ and scaling factor $\lambda \in \mathbb{R}$, we can construct the kernel ${\lambda}^{2}k$ with feature map $\lambda \varphi $. This scaling can make a difference if we subsequently consider a Gaussian Process (GP) with covariance function ${\lambda}^{2}k$. In this case, ${\lambda}^{2}k(\bm{x},\stackrel{~}{\bm{x}})$ describes the covariance between $f(\bm{x})$ and $f(\stackrel{~}{\bm{x}})$ under the prior distribution over functions $f$. Since we train with normalized labels, ${N}_{\mathrm{train}}^{1}{\sum}_{y\in {\mathcal{Y}}_{\mathrm{train}}}{y}_{i}^{2}\approx 1$, we would like to choose the scaling factor $\lambda $ such that ${N}_{\mathrm{train}}^{1}{\sum}_{\bm{x}\in {\mathcal{X}}_{\mathrm{train}}}{\lambda}^{2}k(\bm{x},\bm{x})=1$. Therefore, we propose the automatic scale normalization +rCl+x* k_→scale(X_train)(x, ~x) ≔λ^2 k(x, ~x), λ≔(1Ntrain ∑_x∈X_train k(x, x))^1/2 .
4.2.2 Gaussian Process Posterior Transformation
For a given kernel $k$ with corresponding feature map $\varphi $, we can consider a Gaussian Process (GP) with kernel $k$, which is equivalent to a Bayesian linear regression model with feature map $\varphi $: In feature space, we model our observations as ${y}_{i}={\bm{w}}^{\top}\varphi ({\bm{x}}_{i})+{\epsilon}_{i}$ with weight prior $\bm{w}\sim \mathcal{N}(\mathrm{\U0001d7ce},\bm{I})$ and i.i.d. observation noise ${\epsilon}_{i}\sim \mathcal{N}(0,{\sigma}^{2})$. The random function $f({\bm{x}}_{i})\u2254{\bm{w}}^{\top}\varphi ({\bm{x}}_{i})$ now has the covariance function $\mathrm{Cov}(f({\bm{x}}_{i}),f({\bm{x}}_{j}))=\varphi {({\bm{x}}_{i})}^{\top}\varphi ({\bm{x}}_{j})=k({\bm{x}}_{i},{\bm{x}}_{j})$.
It is wellknown, see e.g. Section 2.1 and 2.2 in bishop_pattern_2006, that the posterior distribution of a Gaussian process after observing the training data ${\mathcal{D}}_{\mathrm{train}}$ with inputs ${\mathcal{X}}_{\mathrm{train}}$ is also a Gaussian process with kernel
+rCl+x*
& k_→post(X_train, σ^2)(x, ~x)
≔ Cov(f(x), f(~x) ∣X_train, Y_train)
= k(x, ~x)  k(x, X_train) (k(X_train, X_train) + σ^2 I)^1 k(X_train, ~x)
=see below ϕ(x)^⊤(σ^2 ϕ(X_train)^⊤ϕ(X_train) + I)^1 ϕ(~x)
= σ^2 ϕ(x)^⊤(ϕ(X_train)^⊤ϕ(X_train) + σ^2 I)