Contrastive Out-of-Distribution Detection for Pretrained Transformers

04/18/2021
by   Wenxuan Zhou, et al.
0

Pretrained transformers achieve remarkable performance when the test data follows the same distribution as the training data. However, in real-world NLU tasks, the model often faces out-of-distribution (OoD) instances. Such instances can cause the severe semantic shift problem to inference, hence they are supposed to be identified and rejected by the model. In this paper, we study the OoD detection problem for pretrained transformers using only in-distribution data in training. We observe that such instances can be found using the Mahalanobis distance in the penultimate layer. We further propose a contrastive loss that improves the compactness of representations, such that OoD instances can be better differentiated from in-distribution ones. Experiments on the GLUE benchmark demonstrate the effectiveness of the proposed methods.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/31/2023

LaCViT: A Label-aware Contrastive Training Framework for Vision Transformers

Vision Transformers have been incredibly effective when tackling compute...
research
04/13/2020

Pretrained Transformers Improve Out-of-Distribution Robustness

Although pretrained Transformers such as BERT achieve high accuracy on i...
research
03/10/2023

Contrastive Language-Image Pretrained (CLIP) Models are Powerful Out-of-Distribution Detectors

We present a comprehensive experimental study on pretrained feature extr...
research
12/20/2022

Improving the Robustness of Summarization Models by Detecting and Removing Input Noise

The evaluation of abstractive summarization models typically uses test d...
research
10/05/2020

How Effective is Task-Agnostic Data Augmentation for Pretrained Transformers?

Task-agnostic forms of data augmentation have proven widely effective in...
research
03/12/2023

ContraNorm: A Contrastive Learning Perspective on Oversmoothing and Beyond

Oversmoothing is a common phenomenon in a wide range of Graph Neural Net...
research
10/14/2022

Pretrained Transformers Do not Always Improve Robustness

Pretrained Transformers (PT) have been shown to improve Out of Distribut...

Please sign up or login with your details

Forgot password? Click here to reset