Large Language Models on Fine-grained Emotion Detection Dataset with Data Augmentation and Transfer Learning

Kaipeng Wang, Zhi Jing, Yongye Su, Yikun HanarXiv 2024 · DOI

Abstract

Fine-grained emotion detection is a critical yet challenging task in Natural Language Processing, often hindered by severe class imbalances in labeled datasets. This study explores the efficacy of targeted data augmentation and transfer learning to improve classification performance on the GoEmotions benchmark. By utilizing ProtAugment for minority classes and transferring knowledge from the CARER dataset, the researchers achieved a significant improvement in macro-average F1-score. Additionally, the study evaluates the performance of zero-shot Large Language Models (LLMs), finding that specialized fine-tuning remains essential for high-accuracy, fine-grained emotional analysis.

Introduction

Detecting subtle emotional nuances in text is a cornerstone of advanced NLP applications. While sentiment analysis often focuses on binary or ternary classifications (positive, negative, neutral), real-world human emotion is far more complex. The GoEmotions dataset, comprising 58,000 Reddit comments across 27 emotion categories, serves as the primary benchmark for this task. However, the dataset's inherent class imbalance poses a significant hurdle for standard machine learning models.

Addressing the Long Tail of Emotions

A primary challenge in the GoEmotions dataset is the "long tail" distribution of labels. While majority classes like "admiration" are well-represented with over 10,000 examples, minority classes such as "grief" or "pride" often have fewer than 1,000 instances. This imbalance leads to models that perform well on common emotions but fail entirely on rare ones, often yielding F1-scores of zero for the least frequent categories.

Figure 1: Distribution of emotion examples and interrater correlation in the GoEmotions dataset, illustrating the severe class imbalance.

Methodological Framework

The researchers employed a multi-pronged approach to overcome these limitations:

1. Model Selection

Initial experiments compared BERT and RoBERTa architectures. Surprisingly, BERT outperformed RoBERTa for this specific niche classification task, suggesting that model size is not the sole determinant of success in fine-grained emotion detection.

2. Targeted Data Augmentation

The study tested several augmentation techniques, including word-level synonym replacement (DDA) and BERT-based contextual word swapping. However, ProtAugment—which uses a BART model to paraphrase entire sentences—proved most effective. Crucially, the authors found that augmenting the entire dataset introduced noise; instead, applying ProtAugment specifically to the four rarest classes (grief, pride, nervousness, and relief) yielded the best results. For example, the F1-score for "grief" jumped from 0.00 to 0.25 following targeted augmentation.

3. Transfer Learning

To provide the model with a broader understanding of emotional context, the researchers first fine-tuned on the CARER dataset. This dataset focuses on six broad emotional categories, providing a foundation that was then "transferred" to the more complex 28-label GoEmotions task.

Results and LLM Evaluation

The combination of transfer learning and targeted augmentation resulted in a macro-average F1-score of 0.5183, a notable improvement over the original baseline of 0.46. This approach also improved model consistency, reducing the standard deviation of F1 scores across categories from 0.19 to 0.17.

The LLM Gap

A significant finding of this research is the performance gap between specialized models and general-purpose LLMs. In a zero-shot setting, GPT-4 achieved an F1-score of only 12.54%. The model exhibited several failure modes:

  • Hallucination: Proposing labels outside the predefined 28-category taxonomy.
  • Over-labelling: Assigning an excessive number of emotions to single sentences.
  • Over-interpretation: Detecting complex emotions in neutral or simple statements (e.g., interpreting "Ask him out for a drink" as both "desire" and "optimism").

Conclusion

This research underscores that while Large Language Models are powerful, specialized fine-tuning and strategic data handling remain vital for complex classification tasks. Targeted augmentation of minority classes and cross-dataset transfer learning are effective strategies for mitigating class imbalance. Future work should explore few-shot prompting for LLMs and the development of more diverse, globally representative emotion datasets to reduce inherent community biases.

Summary updated

BibTeX
@misc{wang2024large,
  author = {Kaipeng Wang and Zhi Jing and Yongye Su and Yikun Han},
  title = {{Large Language Models on Fine-grained Emotion Detection Dataset with Data Augmentation and Transfer Learning}},
  year = {2024},
  eprint = {2403.06108},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.06108},
}
Figure