[论文解读] Dice Loss for Data-imbalanced NLP Tasks
本文提出 Dice Loss 和一种动态权重方案(adaptive dice loss)来解决 NLP 任务中的数据不平衡,在 POS tagging、NER、MRC 和 paraphrase identification 等任务上取得显著改进,在若干数据集上达到 state-of-the-art 结果。
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.
研究动机与目标
- 针对 NLP 任务中负样本远多于正样本的严重数据不平衡问题的动机。
- 提出用基于 dice 的损失替代交叉熵,以使训练与 F1 评估对齐。
- 引入一个动态的、数据相关的加权机制,在训练过程中降低 easy-negative 的支配地位。
- 在 POS tagging、NER、MRC 和 PI 数据集上展示广泛的经验性收益。
提出的方法
- 将 Dice Loss (DL) 基于 Sørensen–Dice 系数定义为 CE 损失的替代。
- 引入一种 Dice Loss 的变体,其分母平方以实现更快收敛(Milletari et al. 形式)。
- 扩展到 Tversky Index 及相应的 Tversky Loss,以控制精确率-召回率的权衡。
- 提出一种自适应 Dice Loss,通过将 soft probability 乘以衰减因子 (1−p)^α 来降低易负样本的权重(adaptive Dice Loss)。
- 将 Dice Loss 与 focal loss 联系起来,显示在训练中如何强调难负样本。
- 在 POS tagging、NER、MRC 和 PI 上使用多种 backbone(如 BERT、XLNet)进行评估,并报告相对于 CE/MLE 基线的改进。
实验结果
研究问题
- RQ1与交叉熵相比,基于 dice 的损失是否能在不平衡的 NLP 数据集上提升学习效果?
- RQ2训练样本的动态加权是否能减轻 easy-negative 样本的主导地位?
- RQ3Dice Loss、Tversky Loss 及其自适应变体在 POS tagging、NER、MRC 和 PI 任务中的表现如何?
- RQ4Tversky 指数中的超参数对任务表现有何影响?
- RQ5基于 dice 的损失是否会改变像 SST 情感分类这样以准确率为导向的任务的表现?
主要发现
- 与 CE/MLE 基线相比,基于 Dice 的损失在多个人工语言处理任务上实现显著性能提升。
- Adaptive Dice Loss(以 (1−p)^α 加权)降低了易负样本的影响,并使 F1 与训练信号对齐得到改善。
- 在 POS tagging 上,DSC 在 CTB5、CTB6 和 UD1.4 数据集上达到 state-of-the-art。
- 在 NER 上,DSC 在 CoNLL2003、OntoNotes5.0、MSRA 和 OntoNotes4.0 数据集上达到 state-of-the-art。
- 在 MRC(SQuAD v1.1/v2.0, Quoref)和 PI(MRPC/QQP),DSC 始终比强基线(如 BERT/XLNet backbones)提升 EM/F1 分数。
- TI 的超参数(α, β)显著影响结果,不同数据集的最佳 α 值不同(例如,α=0.6 适用于 Chinese OntoNotes4.0 NER,α=0.4 适用于 QuoRef MRC)。
- SST-2 和 SST-5 情感分类结果表明 dice 损失并非以准确率为导向,可能在此类任务上劣于 CE。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。