Training a classifier to find a rare class of documents, such as hate speech directed at a particular religious group, requires labelled examples that are expensive to obtain when the class makes up only a small fraction of a corpus. Active learning reduces this cost, but it must start from an initial labelled set that contains examples of the target class. Random sampling cannot supply these at reasonable cost, so they must be selected in some other way, such as keyword search, and any such selection biases the initial set towards part of the target class. We evaluate whether active learning can correct this bias. On AG News and Measuring Hate Speech, at a prevalence of around 1%, we compare random sampling with eight active learning strategies, starting from initial sets that cover or omit known subgroups of the target class, and measure recall on the omitted subgroups as well as F1. On AG News, almost every strategy recovers the omitted subgroup. On Measuring Hate Speech, uncertainty-based strategies recover less of the omitted subgroups than random sampling, whereas discriminative active learning recovers 55% of them without a significant loss of F1. Aggregate metrics conceal these differences.
Figures & tables
Dataset
Initial set
Target class
Initial-set target documents from
Train size
Test size
% target (train)
AG News
Unbiased
World
World
90,909
5,757
1.00%
Biased
World and Sports
World
60,606
3,838
1.00%
Measuring Hate Speech
Unbiased
Religion targeted
All religions
31,587
7,901
1.34%
Biased
Religion targeted
Muslims
31,587
7,901
1.34%
Table 1: Tasks used in the experiments. “Initial-set target documents from” gives the part of the target class from which the 50 target-class documents in the initial set are drawn. The AG News target class is down-sampled separately for each random seed (Section 5.3 ); the sizes shown are the same for every seed.
AG News
Measuring Hate Speech
Unbiased
Biased
Unbiased
Biased
Method
F1
F1
RU
RR
F1
F1
RU
RR
Random
0.52
0.41
0.56
0.78
0.13
0.13
0.17
0.49
LC
0.69
0.73
0.90
0.68
0.05
0.06
0.02
0.10
BALD
0.68
0.68
0.87
0.65
0.08
0.10
0.09
0.23
Core-Set
0.63
0.69
0.90
0.63
0.11
0.10
0.16
0.30
Table 2: Test performance after the final round (1,100 labelled documents), mean over 25 runs. Unbiased and Biased refer to the initial set. RU : recall on the subgroups unrepresented in the biased initial set; RR : recall on the represented subgroup. Bold: best method in the column; underlined: not significantly worse than the best (paired t -test across runs, Holm-corrected over the eight comparisons in the column, p≥0.05 ). RR is not tested. Standard errors are in Table 6 .
Figure 1: Recall on the subgroups unrepresented in the initial set ( RU ) against F1 after the final round, with a biased initial set. Points are means over 25 runs, with standard errors. The grey line joins methods not outperformed on both metrics by any other method.
Figure 2: Recall on the represented subgroup ( RR , open) and on the unrepresented subgroups ( RU , filled) after the final round, with a biased initial set, mean over 25 runs. A method that corrects the bias of the initial set closes the gap between the two.
Figure 3: Target-class documents from the unrepresented subgroups (top) and from the represented subgroup (bottom) selected for labelling, cumulatively over rounds, with a biased initial set. Mean over 25 runs; excludes the 50 target-class documents in the initial set.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Strategy
Settings
BALD
10 dropout samples
Core-Set
Greedy k -centre; Euclidean distance between unit-normalised embeddings
Table 3: Settings of the small-text query strategies. LC and random sampling have no settings.
Hyperparameter
Value
Pretrained model
distilroberta-base
Maximum input length
100 tokens
Training epochs per round
10
Batch size
32
Learning rate
5×10−5
Loss weighting
Inverse class frequency
Appendix
Table 4: Classifier hyperparameters.
Epochs
Dataset
Initial set
3
5
8
10
F1
AG News
Unbiased
0.51
0.57
0.47
0.55
AG News
Biased
0.46
0.51
0.44
0.47
Measuring Hate Speech
Unbiased
0.15
0.18
0.10
0.17
Measuring Hate Speech
Biased
0.11
0.10
0.19
0.15
Appendix
Table 5: Epoch tuning: final-round test performance of random sampling, mean over three runs (two runs for AG News unbiased at three epochs and Measuring Hate Speech biased at eight epochs, where a run did not complete).
Figure 4: Test F1 after each round (top) and target-class documents selected for labelling, cumulatively over rounds (bottom), mean over 25 runs. The bottom row excludes the 50 target-class documents in the initial set.
AG News
Measuring Hate Speech
Unbiased
Biased
Unbiased
Biased
Method
F1
F1
RU
RR
F1
F1
RU
RR
Random
0.52 ± 0.01
0.41 ± 0.02
0.56 ± 0.06
0.78 ± 0.02
0.13 ± 0.02
0.13 ± 0.01
0.17 ± 0.03
0.49 ± 0.05
LC
0.69 ± 0.01
0.73 ± 0.01
0.90 ± 0.02
0.68 ± 0.02
0.05 ± 0.02
0.06 ± 0.02
0.02 ± 0.01
0.10 ± 0.03
BALD
0.68 ± 0.01
0.68 ± 0.03
0.87 ± 0.04
0.65 ± 0.04
0.08 ± 0.02
0.10 ± 0.02
0.09 ± 0.03
0.23 ± 0.05
Core-Set
0.63 ± 0.03
0.69 ± 0.01
0.90 ± 0.01
0.63 ± 0.03
0.11 ± 0.02
0.10 ± 0.02
0.16 ± 0.04
0.30 ± 0.06
Appendix
Table 6: The results in Table 2 , with standard errors over the 25 runs.
AG News, unbiased
Measuring Hate Speech, unbiased
AG News, biased
Measuring Hate Speech, biased
Method
P
R
P
R
P
R
P
R
Random
0.42 ± 0.02
0.73 ± 0.02
0.08 ± 0.01
0.35 ± 0.05
0.32 ± 0.02
0.67 ± 0.03
0.11 ± 0.01
0.31 ± 0.04
LC
0.70 ± 0.01
0.70 ± 0.01
0.10 ± 0.04
0.05 ± 0.02
0.69 ± 0.02
0.79 ± 0.02
0.12 ± 0.03
0.06 ± 0.02
BALD
0.69 ± 0.02
0.69 ± 0.02
0.06 ± 0.02
0.14 ± 0.04
0.63 ± 0.03
0.76 ± 0.04
0.11 ± 0.02
0.15 ± 0.04
Core-Set
0.63 ± 0.02
0.68 ± 0.03
0.09 ± 0.02
0.30 ± 0.05
0.64 ± 0.02
0.76 ± 0.02
0.10 ± 0.02
0.22 ± 0.05
BADGE
0.68 ± 0.02
0.69 ± 0.03
0.10 ± 0.02
0.13 ± 0.03
0.67 ± 0.02
0.78 ± 0.02
0.12 ± 0.02
0.15 ± 0.03
Appendix
Table 7: Precision (P) and recall (R) of the target class after the final round, mean ± standard error over 25 runs.
AG News, unbiased
Measuring Hate Speech, unbiased
AG News, biased
Measuring Hate Speech, biased
Method
Macro
Worst
Macro
Worst
Macro
Worst
Macro
Worst
Random
0.73 ± 0.02
0.73 ± 0.02
0.30 ± 0.05
0.03 ± 0.01
0.67 ± 0.03
0.54 ± 0.05
0.20 ± 0.03
0.00 ± 0.00
LC
0.70 ± 0.01
0.70 ± 0.01
0.05 ± 0.02
0.00 ± 0.00
0.79 ± 0.02
0.68 ± 0.02
0.04 ± 0.01
0.00 ± 0.00
BALD
0.69 ± 0.02
0.69 ± 0.02
0.12 ± 0.03
0.01 ± 0.01
0.76 ± 0.04
0.64 ± 0.04
0.10 ± 0.03
0.00 ± 0.00
Core-Set
0.68 ± 0.03
0.68 ± 0.03
0.32 ± 0.06
0.10 ± 0.04
0.76 ± 0.02
0.63 ± 0.03
0.16 ± 0.04
0.00 ± 0.00
BADGE
0.69 ± 0.03
0.69 ± 0.03
0.10 ± 0.03
0.01 ± 0.01
0.78 ± 0.02
0.65 ± 0.03
0.11 ± 0.02
0.00 ± 0.00
Appendix
Table 8: Recall averaged over the subgroups of the target class (Macro) and on the subgroup with the lowest recall (Worst) after the final round, mean ± standard error over 25 runs. With an unbiased initial set, the AG News target class has a single subgroup, so both equal recall. In Measuring Hate Speech the smallest subgroup has one test document, so worst-group recall is coarse.