[Paper Review] Dice Loss for Data-imbalanced NLP Tasks
The paper introduces dice loss and a dynamic weighting scheme (adaptive dice loss) to address data imbalance in NLP tasks, showing significant improvements across POS tagging, NER, MRC, and paraphrase identification, with state-of-the-art results on several datasets.
Many NLP tasks such as tagging and machine reading comprehension are faced with the severe data imbalance issue: negative examples significantly outnumber positive examples, and the huge number of background examples (or easy-negative examples) overwhelms the training. The most commonly used cross entropy (CE) criteria is actually an accuracy-oriented objective, and thus creates a discrepancy between training and test: at training time, each training instance contributes equally to the objective function, while at test time F1 score concerns more about positive examples. In this paper, we propose to use dice loss in replacement of the standard cross-entropy objective for data-imbalanced NLP tasks. Dice loss is based on the Sorensen-Dice coefficient or Tversky index, which attaches similar importance to false positives and false negatives, and is more immune to the data-imbalance issue. To further alleviate the dominating influence from easy-negative examples in training, we propose to associate training examples with dynamically adjusted weights to deemphasize easy-negative examples.Theoretical analysis shows that this strategy narrows down the gap between the F1 score in evaluation and the dice loss in training. With the proposed training objective, we observe significant performance boost on a wide range of data imbalanced NLP tasks. Notably, we are able to achieve SOTA results on CTB5, CTB6 and UD1.4 for the part of speech tagging task; SOTA results on CoNLL03, OntoNotes5.0, MSRA and OntoNotes4.0 for the named entity recognition task; along with competitive results on the tasks of machine reading comprehension and paraphrase identification.
Motivation & Objective
- Motivation to address severe data imbalance in NLP tasks where negative examples vastly outnumber positives.
- Propose replacing cross-entropy with dice-based losses to align training with F1 evaluation.
- Introduce a dynamic, data-dependent weighting mechanism to reduce easy-negative dominance during training.
- Demonstrate broad empirical gains across POS tagging, NER, MRC, and PI datasets.
Proposed method
- Define Dice Loss (DL) based on the Sørensen–Dice coefficient as a replacement for CE loss.
- Introduce a variant of Dice Loss that uses the squared denominator for faster convergence (Milletari et al. form).
- Extend to Tversky Index and corresponding Tversky Loss to control precision-recall tradeoffs.
- Propose a self-adjusting Dice Loss by multiplying the soft probability by a decaying factor (1−p)^α to down-weight easy negatives (adaptive Dice Loss).
- Relate Dice Loss to focal loss, showing how it emphasizes hard negatives during training.
- Evaluate on POS tagging, NER, MRC, and PI with various backbones (e.g., BERT, XLNet) and report improvements over CE/MLE baselines.
Experimental results
Research questions
- RQ1Can dice-based losses improve learning on imbalanced NLP datasets compared to cross-entropy?
- RQ2Does a dynamic weighting of training examples mitigate the dominance of easy-negative samples?
- RQ3How do Dice Loss, Tversky Loss, and their adaptive variants perform across POS tagging, NER, MRC, and PI tasks?
- RQ4What are the effects of hyperparameters in the Tversky index on task performance?
- RQ5Do dice-based losses alter performance on accuracy-oriented tasks like SST sentiment classification?
Key findings
- Dice-based losses yield significant performance gains across multiple NLP tasks compared to CE/MLE baselines.
- Adaptive Dice Loss (with (1−p)^α weighting) reduces the impact of easy negatives and improves F1 alignment with training signals.
- On POS tagging, DSC achieves state-of-the-art results on CTB5, CTB6, and UD1.4 datasets.
- On NER, DSC achieves state-of-the-art on CoNLL2003, OntoNotes5.0, MSRA, and OntoNotes4.0 datasets.
- In MRC (SQuAD v1.1/v2.0, Quoref) and PI (MRPC/QQP), DSC consistently improves EM/F1 scores over strong baselines (e.g., BERT XLNet backbones).
- Hyperparameters of the TI (α, β) significantly influence results, with best α values differing by dataset (e.g., α=0.6 for Chinese OntoNotes4.0 NER, α=0.4 for QuoRef MRC).
- SST-2 and SST-5 sentiment classification results show dice losses are not accuracy-oriented and may underperform CE on such tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.