Multi-Level Knowledge Distillation for Out-of-Distribution Detection in Text

Qianhui Wu, Huiqiang Jiang, Haonan Yin, Börje F. Karlsson, Chin-Yew Lin
11/21/2022
cs.CLcs.AI
distillation

Official code: microsoft/KC (90 stars, Python, MIT, last commit 2023-09-07).

Abstract

Self-supervised representation learning has proved to be a valuable component for out-of-distribution (OoD) detection with only the texts of in-distribution (ID) examples. These approaches either train a language model from scratch or fine-tune a pre-trained language model using ID examples, and then take the perplexity output by the language model as OoD scores.

Show full abstract

In this paper, we analyze the complementary characteristics of both OoD detection methods and propose a multi-level knowledge distillation approach that integrates their strengths while mitigating their limitations. Specifically, we use a fine-tuned model as the teacher to teach a randomly initialized student model on the ID examples. Besides the prediction layer distillation, we present a similarity-based intermediate layer distillation method to thoroughly explore the representation space of the teacher model. In this way, the learned student can better represent the ID data manifold while gaining a stronger ability to map OoD examples outside the ID data manifold with the regularization inherited from pre-training. Besides, the student model sees only ID examples during parameter learning, further promoting more distinguishable features for OoD detection. We conduct extensive experiments over multiple benchmark datasets, i.e., CLINC150, SST, ROSTD, 20 NewsGroups, and AG News; showing that the proposed method yields new state-of-the-art performance. We also explore its application as an AIGC detector to distinguish between answers generated by ChatGPT and human experts. It is observed that our model exceeds human evaluators in the pair-expert task on the Human ChatGPT Comparison Corpus.

View on arXivView PDF

Code Implementations(1)

microsoft/KCOfficial100%
MIT

Knowledge Computing group - MSRA

9023Python, JavaScriptJul 7, 20213 years agoMIT

Similar Papers

Cite this paper

@article{wu2022multilevel,
  title  = {Multi-Level Knowledge Distillation for Out-of-Distribution Detection in Text},
  author = {Qianhui Wu and Huiqiang Jiang and Haonan Yin and Börje F. Karlsson and Chin-Yew Lin},
  year   = {2022},
  eprint = {2211.11300},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.11300}
}

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

Discussion