MASKER: Masked Keyword Regularization for Reliable Text Classification

Seung Jun Moon, Sangwoo Mo, Kimin Lee, Jaeho Lee, Jinwoo Shin
12/17/2020
cs.LGcs.CL

Official code: alinlab/MASKER (54 stars, Python, last commit 2023-10-04).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

alinlab/MASKEROfficial100%

MASKER: Masked Keyword Regularization for Reliable Text Classification (AAAI 2021)

5411PythonDec 2, 20203 years ago
domain-generalizationout-of-distribution-detectiontext-classification

Similar Papers

Cite this paper

@article{moon2020masker,
  title  = {MASKER: Masked Keyword Regularization for Reliable Text Classification},
  author = {Seung Jun Moon and Sangwoo Mo and Kimin Lee and Jaeho Lee and Jinwoo Shin},
  year   = {2020},
  eprint = {2012.09392},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2012.09392}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2012.09392.svg)](https://codeofpaper.com/paper/2012.09392)

Discussion