Is BERT Robust to Label Noise? A Study on Learning with Noisy Labels in Text Classification (2022)

Abstract: Incorrect labels in training data occur when human annotators make mistakes or when the data is generated via weak or distant supervision. It has been shown that complex noise-handling techniques - by modeling, cleaning or filtering the noisy instances - are required to prevent models from fitting this label noise. However, we show in this work that, for text classification tasks with modern NLP models like BERT, over a variety of noise types, existing noise-handling methods do not always improve its performance, and may even deteriorate it, suggesting the need for further investigation. We also back our observations with a comprehensive analysis.

## introduction for many languages, domains and tasks, large datasets with high-quality labels are not available. to tackle this issue, cheaper data acquisition methods have been suggested, such as crowdsourcing or automatic annotation methods like weak and distant supervision. unfortunately, compared to gold-standard data, these approaches come with more labeling mistakes, which are known as noisy labels. noise-handling has become an established approach to mitigate the negative impact of learning with noisy labels. a variety of methods have been proposed that model the noise, or clean and filter the noisy instances @xcite . @xcite show e.g. a 30% boost in performance after applying noise-handling techniques on a cnn-based text classifier. in a recent work, @xcite showed that bert @xcite has an inherent robustness against noisy labels. the generalization performance on the clean distribution drops only slowly with the increase of the mislabeled samples. also, they show that early-stopping is crucial for learning with noisy labels as bert will eventually memorize all wrong labels when trained long 0 2500 5000 7500 10000 12500 15000 17500 train iterations 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.94 test accuracy without noise-handling co-teaching noise matrix noise model with regularization label smoothing figure 1: a typical training curve when learning with noise. learning without noise-handling (blue) will reach a peak accuracy before memorizing the noise. early-stopping on a noisy validation set (vertical grey line) is often sufficient to find such a peak. injected uniform noise of 40% on ag-news dataset. in this work, we investigate the behaviors of bert on tasks with different noise types and noise levels. we also study the effect of noise-handling methods under these settings. our main results include (1) bert is robust against injected noise, but could be vulnerable to noise from weak supervision. in fact, the latter, even at a low level, can be more challenging than high injected noise. (2) existing noise-handling methods do not improve the peak performance of bert under any noise settings we investigated; as is shown with further analysis, noise-handling methods rarely render the correct labels more distinguishable from the incorrect ones. 1 2 learning with noisy labels problem settings we consider a k-class classification problem. let d denote the true data generation distribution over x × y where x is the feature space and @xmath0, ..., k} is the label space. in a typical classification task, we are provided with a training dataset @xmath1, y i ) n @xmath2. in learning with noisy labels, however, we have no access to d. instead, a noisy training set ŝ = {(x i , ŷi ) n @xmath3. the goal is to learn a classifier that generalizes well on the clean distribution by only exploiting ŝ. injected label noise to rigorously evaluate noise-handling methods at different noise levels, researchers in this area often construct noisy datasets from clean ones by injecting noise. this can, e.g., reflect annotation scenarios such as crowdsourcing, where some annotators answer randomly or prefer an early entry in a list of options. modeling such noise is achieved by flipping the labels of the clean instances according to a pre-defined noise level ε ∈ [0, 1) and a noise type. there are two commonly used noise types: the single-flip noise @xcite : these noise generation processes are featureindependent, i.e. p(•|@xmath4, x) = p(•|@xmath5. therefore, they can be described by a noise transition matrix t with t ij := p(ŷ = j|@xmath6. it is usually assumed that the noise is diagonallydominant when generating the noisy labels, i.e. ∀i, label noise from weak supervision distant and weak supervision @xcite have become essential methods to acquire labeled data in low-resource scenarios. the resulting noise, unlike injected noise, is often feature-dependent @xcite . we evaluate our methods on two real-world datasets in hausa and yorùbá to cover this type of noise. ## early-stopping on noisy validation set when trainied on noisy data without noisehandling, bert reaches a high generalization performance before it starts fitting the noise. then it memorizes the noise and the performance on clean distribution drops dramatically (the blue curve in figure 1 ). hence, for models without noisehandling, it is crucial to stop training when the generalization performance reaches its maximum. @xcite use a clean validation set to find this point. however, a clean validation set is often unavailable in realistic low-resource scenarios as it requires manual annotation. therefore, we use a noisy validation set for early-stopping in all of our experiments and we attain models that generalize well on the clean distribution. in our example in figure 1 , we see that while most noise-handling methods prevent bert from fitting the noise in the long run, their peak performance is not significantly higher than a vanilla model without noise-handling. ## experiments dataset construction we experiment with four text classification datasets: two benchmarks, ag-news @xcite and imdb @xcite , injected with different levels of single-flip or uniform noise; for the weakly supervised noise, we make use of two news topics datasets in two lowresource languages: hausa and yorùbá @xcite . hausa and yorùbá are the second and the third most spoken indigenous language in africa, with 40 and 35 million native speakers, respectively @xcite . the noisy labels were gazetteered. for example, to identify texts for the class "africa", a labeling rule based on a list of african countries and their capitals is used. note that while we can vary the noise levels of injected noise, the amount of weak supervision noise in hausa and yorùbá is fixed foot_1 . we summarize some basic statistics of the datasets in implementation we use of-the-shelf bert models for our tasks. specifically, we apply the bertbase model for ag-news and imdb, and the mbert-base for yorùbá and hausa. the finetuning approach follows @xcite . in all settings, we apply early-stopping on a noisy validation set to mimic the realistic low-resource settings, while the test set remains clean. for more implementation details and a discussion on clean and noisy validation sets, see appendix b and e. ## conclusion on several text classification datasets and for different noise types, we showed that bert is noise resistant under injected noise, but not necessarily under weak supervision noise. in both cases, the improvement obtained by applying noise-handling methods are limited. our analysis on the separability of losses corresponding to correct and incorrect labeled samples provides evidence to this argument. our analysis offers both motivation and insights to further improve label noise-handling methods and make them useful on more realistic types of noise.