A Survey of Methods for Addressing Class Imbalance in Deep-Learning Based Natural Language Processing

Sophie Henning, William H. Beluch, Alexander Fraser, Annemarie Friedrich

Abstract

Many natural language processing (NLP) tasks are naturally imbalanced, as some target categories occur much more frequently than others in the real world. In such scenarios, current NLP models still tend to perform poorly on less frequent classes. Addressing class imbalance in NLP is an active research topic, yet, finding a good approach for a particular task and imbalance scenario is difficult. With this survey, the first overview on class imbalance in deep-learning based NLP, we provide guidance for NLP researchers and practitioners dealing with imbalanced data. We first discuss various types of controlled and real-world class imbalance. Our survey then covers approaches that have been explicitly proposed for class-imbalanced NLP tasks or, originating in the computer vision community, have been evaluated on them. We organize the methods by whether they are based on sampling, data augmentation, choice of loss function, staged learning, or model design. Finally, we discuss open problems such as dealing with multi-label scenarios, and propose systematic benchmarking and reporting in order to move forward on this problem as a community.

Introduction: The Challenge of Imbalanced Data

In the real world, data is rarely distributed evenly. Whether you are classifying rare diseases in medical records or identifying hate speech in a sea of benign tweets, the "interesting" classes are often the least frequent. Standard deep learning models, including powerful Transformers like BERT, are "greedy"—they tend to over-optimize for the majority classes to achieve high overall accuracy, often failing significantly on the minority classes.

While computer vision has a long history of addressing this "long-tail" problem, NLP has lacked a unified overview of how these challenges manifest in text and which solutions actually work. This survey defines the types of imbalance (Step, Linear, and Long-tailed) and the unique challenges of NLP, such as the "catch-all" class (e.g., the "Outside" label in named entity recognition) that can obscure minority signals.

The long-tail distribution of training instances (top) and its impact on classification performance (bottom), where rare labels suffer from significantly lower F1 scores.

Taxonomy of Solutions

The survey categorizes the landscape of solutions into five main pillars:

  1. Re-Sampling: This includes Random Oversampling (ROS) of minority instances or Random Undersampling (RUS) of majority ones. Class-Aware Sampling (CAS) is also highlighted, ensuring each class is seen equally during a training batch.
  2. Data Augmentation: Techniques range from simple string manipulations (EDA) and back-translation to generating new examples using LLMs. Advanced "hidden space" methods like GE3 or MISO create new feature vectors directly in the model's internal representation space.
  3. Loss Functions: Modifying the penalty for mistakes. Focal Loss down-weights easy majority examples, while LDAM (Label-Distribution-Aware Margin) encourages larger margins for minority classes.
  4. Staged Learning: A two-step approach where the model first learns general features from the full distribution and then "fine-tunes" only the classification head on a balanced subset (e.g., cRT).
  5. Model Design: Architectures specifically built for imbalance, such as ProtoBERT, which uses class prototypes, or HSCNN, which uses specialized branches for the "tail" of the distribution.

Key Insights and Ideas

  • The "Catch-all" Complexity: Many NLP tasks have a massive, heterogeneous "Other" or "Outside" class. Standard imbalance techniques often fail here because this class is too diverse to be treated as a single majority block.
  • Representation vs. Classification: Imbalance affects the classifier more than the feature extractor. Staged learning (freezing the encoder and re-training the head) is often more effective than trying to balance everything at once.
  • Transformers aren't a Silver Bullet: While pre-trained models like BERT handle minority classes better than older RNNs, they still require significant data (often at least 100 instances) to learn a class reliably.
  • The Multi-label Headache: In multi-label settings, balancing one class often inadvertently unbalances another, making it an open research issue.

Key Results and Benchmarks

The survey reviews results across standard NLP benchmarks like TACRED, PDTB, and Patent Classification. Key findings include:

  • Incorporating imbalance-specific methods can lead to performance gains of up to 20% on minority classes.
  • Data Augmentation generally yields larger gains than simple re-sampling or loss function changes, though it is computationally more expensive.
  • The authors provide a practical decision tree to help engineers choose a method based on their constraints (e.g., limited compute vs. limited implementation time).
Performance across relation types in the TACRED dataset, demonstrating the correlation between training instance count and dev F1 score.

Limitations and Future Work

The authors identify several "blind spots" in current research:

  • Lack of Benchmarks: There is no "ImageNet-LT" equivalent for NLP—a standardized, long-tailed benchmark for fair comparisons.
  • Evaluation Gaps: Many papers still only report aggregate statistics. The community is urged to always report per-class statistics.
  • Calibration: We don't yet fully understand how these balancing methods affect a model's confidence calibration.

Summary updated

Abstract

Many natural language processing (NLP) tasks are naturally imbalanced, as some target categories occur much more frequently than others in the real world. In such scenarios, current NLP models still tend to perform poorly on less frequent classes. Addressing class imbalance in NLP is an active research topic, yet, finding a good approach for a particular task and imbalance scenario is difficult. With this survey, the first overview on class imbalance in deep-learning based NLP, we provide guidance for NLP researchers and practitioners dealing with imbalanced data. We first discuss various types of controlled and real-world class imbalance. Our survey then covers approaches that have been explicitly proposed for class-imbalanced NLP tasks or, originating in the computer vision community, have been evaluated on them. We organize the methods by whether they are based on sampling, data augmentation, choice of loss function, staged learning, or model design. Finally, we discuss open problems such as dealing with multi-label scenarios, and propose systematic benchmarking and reporting in order to move forward on this problem as a community.
BibTeX
@inproceedings{henning2023survey,
  author = {Sophie Henning and William H. Beluch and Alexander Fraser and Annemarie Friedrich},
  title = {{A Survey of Methods for Addressing Class Imbalance in Deep-Learning Based Natural Language Processing}},
  booktitle = {EACL},
  year = {2023},
  url = {https://openreview.net/forum?id=DggZ0Zm_by},
}
Figure