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

38465

Authors

nan

Abstract

AbstractSelf-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. In this paper, we analyze the complementary characteristic of both 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 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.

Keywords

nan

Full Content

Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics Volume 1: Long Papers, pages 7317–7332 July 9-14, 2023 ©2023 Association for Computational Linguistics Multi-Level Knowledge Distillation for Out-of-Distribution Detection in Text Qianhui Wu1, Huiqiang Jiang1, Haonan Yin2, Börje F. Karlsson1, Chin-Yew Lin1 1 Microsoft 2 Tsinghua University {qianhuiwu, hjiang, borjekar, cyl}@microsoft.com yhn21@mails.tsinghua.edu.cn 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. 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 limita- tions. 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 distilla- tion method to thoroughly explore the repre- sentation 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 learn- ing, further promoting more distinguishable features for OoD detection. We conduct ex- tensive 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 performance1. We also explore its application as an AIGC detector to distinguish between answers generated by ChatGPT and human ex- perts. It is observed that our model exceeds human evaluators in the pair-expert task on the Human ChatGPT Comparison Corpus. 1 Introduction Machine learning systems such as dialog agents are widely used in many real-world applications. 1Our code is available at https://github.com/ microsoft/KC/tree/main/papers/MLKD_OOD. 0 5 10 log_ppl 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Density M_ft_id M_ft_od (a) Mfinetune 0 5 10 log_ppl 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Density M_scratch_id M_scratch_od (b) MfromScrach 0 5 10 log_ppl 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Density ours_id ours_od (c) Ours Figure 1: Visualization of OoD-score distribution of both ID and OoD examples2. Less overlap is preferred. These systems have proved to work well when the distributions of training data and test data are the same or closely similar. However, when there is a gap between training distribution and test distri- bution, trained models may generate dubious, and even disastrous, predictions that could cause seri- ous AI safety issues (Hendrycks and Gimpel, 2017). Therefore, it is crucial to detect out-of-distribution (OoD) inputs for deployed machine learning sys- tems. Moreover, lifelong learning systems are usu- ally required to discover OoD examples during their application to create new tasks and learn them incrementally (Liu and Mazumder, 2021), which further highlights the importance of OoD detection. In this paper, we …

Content truncated to 500 words

Labeled Text

AbstractSelf-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. In this paper, we analyze the complementary characteristic of both 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 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.

Publication Details

Paper ID:
38465
Year:
2023
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan