Source-linked AI summary

Revisiting Uncertainty-based Query Strategies for Active Learning with Transformers

Christopher Schröder, Andreas Niekler, Martin Potthast

arXiv:2107.05687v2cs.CLcs.LG

TL;DR

Transformer active learning lacks systematic evidence because sophisticated query strategies impose prohibitive runtime costs, while prior work has often used limited-cost settings. This paper evaluates uncertainty-based strategies with BERT and DistilRoBERTa across five benchmarks and finds that several outperform prediction entropy, especially Breaking Ties, while active learning approaches state-of-the-art performance on four of five datasets using little data.

  • Problem

    Transformer active learning has been comparatively little studied because advanced query strategies can impose prohibitive runtime overhead, undermining labeling-cost savings.

    Source: §1 · p. 1, §2 · p. 2
  • Method

    The paper evaluates five query strategies with fine-tuned BERT and DistilRoBERTa on five sentence-classification benchmarks using an iterative pool-based active-learning setup.

    Source: §1 · p. 1, §3 · pp. 2–3
  • Results

    Several uncertainty-based strategies outperform prediction entropy, while active learning reaches results close to state-of-the-art text classification on four of five datasets using only a small fraction of training data.

    Source: §5 · p. 5, §4 · p. 5
  • Takeaways & Limitations

    Breaking Ties is a strong candidate for a default uncertainty baseline, and DistilRoBERTa offers results close to BERT with substantially lower parameter and computational overhead.

    Source: §4 · p. 5, §5 · p. 5

    The approach relies on pre-trained language models whose biases can affect all fine-tuning-based approaches and therefore require mitigation.

    Source: Ethical Considerations · p. 6

Abstract

from arXiv · show

Active learning is the iterative construction of a classification model through targeted labeling, enabling significant labeling cost savings. As most research on active learning has been carried out before transformer-based language models ("transformers") became popular, despite its practical importance, comparably few papers have investigated how transformers can be combined with active learning to date. This can be attributed to the fact that using state-of-the-art query strategies for transformers induces a prohibitive runtime overhead, which effectively nullifies, or even outweighs the desired cost savings. For this reason, we revisit uncertainty-based query strategies, which had been largely outperformed before, but are particularly suited in the context of fine-tuning transformers. In an extensive evaluation, we connect transformers to experiments from previous research, assessing their performance on five widely used text classification benchmarks. For active learning with transformers, several other uncertainty-based approaches outperform the well-known prediction entropy query strategy, thereby challenging its status as most popular uncertainty baseline in active learning for text classification.

1 Introduction

Active learning reduces labeling costs by selecting informative instances for labeling, but transformer-based approaches make many advanced query strategies computationally expensive. This paper therefore systematically evaluates uncertainty-based strategies as an efficient alternative with transformer models.

  • Active learning lowers labeling costs by querying an oracle to label instances selected as informative for the model’s next iteration.Source: §1 · p. 1
  • Transformer parameters make neural-network and text-classification query strategies computationally expensive, causing prohibitive turnaround times between labeling steps.Source: §1 · p. 1
  • Pre-trained transformers can be fine-tuned with far less labeled data than training models from scratch, making them relevant to low-data active-learning settings.Source: §1 · p. 1
  • The paper evaluates uncertainty-based query strategies with BERT and DistilRoBERTa across five sentence-classification benchmarks and five query strategies.Source: §1 · p. 1

2 Related Work

Earlier active-learning work favored gradient-, representativity-, ensemble-, or entropy-based strategies, but transformers make several of these approaches costly. The paper addresses the limited systematic evidence by reevaluating uncertainty strategies and comparing them with prior benchmarks.

  • Gradient-based strategies require per-instance computation and scale with a transformer’s many parameters, making them especially expensive.Source: §2 · p. 2
  • Transformer active learning is constrained by ensemble costs, gradient strategies’ parameter scaling, and prior evidence that neural networks are overconfident.Source: §2 · p. 2
  • Related work reduced query costs through unlabeled-pool subsampling, larger query batches, or binary classification, but these choices reduce comparability or increase labeling effort.Source: §2 · p. 2
  • Prediction entropy became a common baseline, yet uncertainty strategies had not been systematically analyzed with transformers or compared against Zhang et al. (2017)’s benchmarks.Source: §2 · p. 2
  • The paper reevaluates neglected uncertainty strategies alongside prediction entropy, challenging prediction entropy’s status as the default baseline.Source: §2 · p. 2

3 Transformer-based Active Learning

The study defines pool-based transformer active learning as iterative selection and labeling from an unlabeled pool, then compares uncertainty-based and random query strategies. It fine-tunes BERT and DistilRoBERTa on standard text-classification benchmarks using a fixed active-learning routine.

Transformer-based Active Learning

  • Pool-based active learning repeatedly selects informative unlabeled instances, obtains oracle labels, and retrains or updates the model using all labeled data.Source: §3 · p. 2

Query Strategies

  • The evaluated strategies are Prediction Entropy, Breaking Ties, Least Confidence, Contrastive Active Learning, and Random Sampling.Source: §3 · pp. 2–3
  • Breaking Ties selects instances with the smallest margin between the two most likely class probabilities, while Least Confidence selects instances whose top prediction has the lowest confidence.Source: §3 · pp. 2–3
  • Contrastive Active Learning selects instances whose predicted class distributions differ most, on average, from those of their m nearest neighbors.Source: §3 · p. 3

Oracle

  • The study uses standard text-classification tasks and reports dataset information, including dataset types and whether predefined test sets were adopted.Source: §3 · p. 3, Table 1 · p. 3, Table 2 · p. 3

Classification

  • The experiments fine-tune BERT and the smaller DistilRoBERTa, which has 82M parameters versus BERT’s 336M, and also train a passive full-data model.Source: §3 · p. 3
  • The classifier adds a fully connected projection layer and softmax output layer on top of a transformer’s “[CLS]” sentence representation, with active learning querying 25 instances per iteration.Source: §3 · p. 3

4 Evaluation

The evaluation combines BERT and DistilRoBERTa with five query strategies across five text-classification benchmarks, following an established active-learning setup. Breaking Ties generally outperforms Prediction Entropy with transformers, while DistilRoBERTa approaches BERT using substantially fewer parameters.

Experimental setup

  • The experiments use five established benchmarks spanning binary and multi-class classification, with 25 initial training instances and 20 iterations querying 25 instances each.The benchmark set comprises AG’s News, Customer Reviews, Movie Reviews, Subjectivity, and TREC-6; early stopping uses 10% of labeled data for validation.Source: §4 · pp. 3–4

Results

  • BERT generally learns faster than DistilRoBERTa, but DistilRoBERTa later reaches nearly comparable scores on every dataset except Movie Reviews.The curves compare both models with Prediction Entropy, Breaking Ties, Least Confidence, Contrastive Active Learning, and Random Sampling; the horizontal reference is full-data passive BERT.Source: §4 · p. 4, Figure 1 · p. 4
  • Random Sampling can compete during early iterations on balanced data, yet is usually overtaken later and is less effective on the imbalanced TREC-6 dataset.The early advantage is illustrated for Customer Reviews, while the later pattern reverses in most cases.Source: §4 · p. 4
  • Breaking Ties achieves the best average AUC rankings and scores with transformers, often also leading accuracy, while Least Confidence surpasses Prediction Entropy for DistilRoBERTa.Prediction Entropy is commonly used as a strong baseline, but Breaking Ties is on average superior and Least Confidence can compete with it for DistilRoBERTa.Source: §4 · p. 5
  • Across five datasets, active-learning models use only 0.4% to 14% of training data while approaching or surpassing state-of-the-art results, except for the largest gap on AGN.The largest discrepancy from passive classification occurs on AGN, where active learning uses less than 1% of the data.Source: Table 3 · p. 4, §4 · p. 5
  • BERT obtains the best AUC score on every dataset and substantially improves over Zhang et al. (2017), with Breaking Ties highest in two cases and Contrastive Active Learning in the other two.Table 4 reports best AUC scores averaged over five runs and compares them with Zhang et al. (2017).Source: §4 · p. 5, Table 4 · p. 5

5 Conclusions

On five sentence-classification benchmarks, uncertainty-based strategies paired with BERT and DistilRoBERTa performed well, with breaking ties outperforming prediction entropy.

  • Uncertainty-based strategies achieved results close to state-of-the-art text classification on four of five datasets using only a small fraction of training data.Source: §5 · p. 5
  • Breaking ties outperformed prediction entropy, challenging its status as the default uncertainty baseline for transformer-based active learning.Source: §5 · p. 5
  • The findings show that uncertainty-based strategies remain effective with BERT and DistilRoBERTa for active learning on sentence-classification datasets.Source: §5 · p. 5

Ethical Considerations

Active learning can reduce the labeled data needed for machine learning, but the paper’s use of pretrained models introduces bias considerations that require mitigation.

  • Active learning supports targeted labeling, potentially reducing the data, budget, or time needed to create otherwise infeasible machine-learning models.Source: Ethical Considerations · p. 6
  • Pretrained models may contain one or more types of bias, so bias must be kept in mind and mitigated when using them.Source: Ethical Considerations · p. 6

Supplementary Material

The supplementary material provides reproducibility details, while the technical environment used GPU-accelerated transformer fine-tuning and KimCNN training.

Supplementary Material

  • The experiments can be reproduced using code referenced on the paper’s first page, with supplementary details including results.Source: Supplementary Material · p. 8

A Technical Environment

  • Fine-tuning transformers and training KimCNN were performed on an NVIDIA GeForce RTX 2080 Ti GPU within a Python 3.8 and CUDA 11.1 environment.Source: A Technical Environment · p. 8

B Implementation Details

The implementation used established Python machine-learning libraries and the small-text framework for active learning and text classification.

C Experiments

The experiments combine transformer models with benchmark datasets and active-learning query strategies, using repeated runs and dataset-specific sequence-length settings. The model configurations include DistilRoBERTa and BERT-large.

C Experiments

  • Each experiment configuration combines a model, dataset, and query strategy, and is run five times.A class-balanced initial set supports the first model on the imbalanced TREC-6 dataset.Source: C Experiments · p. 8

C.1 Pre-Trained Models

  • The study fine-tunes DistilRoBERTa and BERT-large as its pretrained transformer models.Source: §C.1 · p. 8
  • Maximum sequence length is configured per dataset using the minimum multiple of ten covering at least 95% of sentences.Source: Table 6 · p. 8

C.2 Datasets

The evaluation uses established text-classification and active-learning datasets accessed through Python libraries, with dataset-specific training settings. Final accuracy and AUC, including standard deviations, are reported after active learning, alongside query-step runtimes.

C.2 Datasets

  • The experiments use well-known text-classification and active-learning benchmarks accessed through gluonnlp and Hugging Face datasets.CR and SUBJ are obtained with gluonnlp, while AGN, MR, and TREC use Hugging Face datasets.Source: §C.2 · p. 9

C.3 Hyperparameters

  • Transformer training uses 50 epochs for AGN, 15 for other datasets, AdamW, a 2e−5 learning rate, and batch size 12.Source: §C.3 · p. 9

D Standard Deviations and Runtimes

D.1 Evaluation Metrics

Active learning is evaluated with accuracy and area under the learning curve using scikit-learn implementations.

D.1 Evaluation Metrics

  • The evaluation uses accuracy and area under the learning curve as its standard active-learning metrics.Source: §D.1 · p. 9
Loading 2107.05687v2…