Unsupervised Out-of-Domain Detection via Pre-trained Transformers

Keyang Xu, Tongzheng Ren, Shikun Zhang, Yihao Feng, Caiming Xiong
6/2/2021
cs.CLcs.LG
transformer-attention

Official code: rivercold/BERT-unsupervised-OOD (30 stars, Python, MIT, last commit 2021-08-20).

Abstract

Deployed real-world machine learning applications are often subject to uncontrolled and even potentially malicious inputs. Those out-of-domain inputs can lead to unpredictable outputs and sometimes catastrophic safety issues.

Show full abstract

Prior studies on out-of-domain detection require in-domain task labels and are limited to supervised classification scenarios. Our work tackles the problem of detecting out-of-domain samples with only unsupervised in-domain data. We utilize the latent representations of pre-trained transformers and propose a simple yet effective method to transform features across all layers to construct out-of-domain detectors efficiently. Two domain-specific fine-tuning approaches are further proposed to boost detection accuracy. Our empirical evaluations of related methods on two datasets validate that our method greatly improves out-of-domain detection ability in a more general scenario.

View on arXivView PDF

Code Implementations(1)

MIT

Code for ACL 2021 paper "Unsupervised Out-of-Domain Detection via Pre-trained Transformers"

301PythonMay 7, 20215 years agoMIT

Similar Papers

Cite this paper

@article{xu2021unsupervised,
  title  = {Unsupervised Out-of-Domain Detection via Pre-trained Transformers},
  author = {Keyang Xu and Tongzheng Ren and Shikun Zhang and Yihao Feng and Caiming Xiong},
  year   = {2021},
  eprint = {2106.00948},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.00948}
}

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/2106.00948.svg)](https://codeofpaper.com/paper/2106.00948)

Discussion