论文标题

蒙版:可靠的文本分类的蒙版关键字正规化

MASKER: Masked Keyword Regularization for Reliable Text Classification

论文作者

Moon, Seung Jun, Mo, Sangwoo, Lee, Kimin, Lee, Jaeho, Shin, Jinwoo

论文摘要

预先训练的语言模型已经在各种文本分类任务上实现了最新的精度,例如情感分析,自然语言推断和语义文本相似性。但是,微调文本分类器的可靠性通常是一个经常被忽视的性能标准。例如,一个人可能希望一个模型可以检测到分布(OOD)样本(远离训练分布)或对域移动的鲁棒性。我们声称,可靠性的一个核心障碍是该模型在有限数量的关键字上的过度依赖,而不是查看整个上下文。特别是,我们发现(a)OOD样本通常包含分布关键字,而(b)跨域样本可能并不总是包含关键字;在两种情况下,关键字过度范围都可能是有问题的。鉴于这种观察,我们提出了一种简单而有效的微调方法,即掩盖关键字正则化(Masker),以促进基于上下文的预测。 Masker将模型正规化,以重建其余单词中的关键字,并在没有足够上下文的情况下进行低信心预测。当应用于各种预训练的语言模型(例如Bert,Roberta和Albert)时,我们证明了Masker会改善OOD检测和跨域概括而不会降低分类精度。代码可从https://github.com/alinlab/masker获得。

Pre-trained language models have achieved state-of-the-art accuracies on various text classification tasks, e.g., sentiment analysis, natural language inference, and semantic textual similarity. However, the reliability of the fine-tuned text classifiers is an often underlooked performance criterion. For instance, one may desire a model that can detect out-of-distribution (OOD) samples (drawn far from training distribution) or be robust against domain shifts. We claim that one central obstacle to the reliability is the over-reliance of the model on a limited number of keywords, instead of looking at the whole context. In particular, we find that (a) OOD samples often contain in-distribution keywords, while (b) cross-domain samples may not always contain keywords; over-relying on the keywords can be problematic for both cases. In light of this observation, we propose a simple yet effective fine-tuning method, coined masked keyword regularization (MASKER), that facilitates context-based prediction. MASKER regularizes the model to reconstruct the keywords from the rest of the words and make low-confidence predictions without enough context. When applied to various pre-trained language models (e.g., BERT, RoBERTa, and ALBERT), we demonstrate that MASKER improves OOD detection and cross-domain generalization without degrading classification accuracy. Code is available at https://github.com/alinlab/MASKER.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源