arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.12715cs.CL
收藏

微调通过扭曲与任务无关的特征来恶化一般文本分布外检测

Fine-Tuning Deteriorates General Textual Out-of-Distribution Detection by Distorting Task-Agnostic Features

Peking University(北京大学)

Sishuo Chen, Wenkai Yang, Xiaohan Bi, Xu Sun

摘要:

检测分发外(OOD)输入对于自然语言处理(NLP)模型的安全部署至关重要。虽然现有的方法,特别是那些基于微调预训练语言模型(PLM)的特征空间中的统计数据的方法,被认为是有效的,但它们对不同类型的分布偏移的有效性仍然有待探索。在这项工作中,我们采取的第一步,全面评估主流的文本OOD检测方法检测语义和非语义的变化。我们发现:(1)没有现有的方法在这两种情况下表现良好;(2)在分布数据上微调PLM有利于检测语义变化,但严重恶化了检测非语义变化,这可以归因于任务不可知特征的扭曲。为了缓解这个问题,我们提出了一个简单而有效的通用OOD得分命名为GNOME,集成了来自任务不可知和特定于任务的表示的置信度得分。实验结果表明,GNOME在语义和非语义迁移场景下都能很好地工作,并在两个跨任务基准测试中两种迁移同时发生的情况下进一步带来了显著的改进。我们的代码可在https://github.com/lancopku/GNOME上获得。

英文摘要:

Detecting out-of-distribution (OOD) inputs is crucial for the safe deployment of natural language processing (NLP) models. Though existing methods, especially those based on the statistics in the feature space of fine-tuned pre-trained language models (PLMs), are claimed to be effective, their effectiveness on different types of distribution shifts remains underexplored. In this work, we take the first step to comprehensively evaluate the mainstream textual OOD detection methods for detecting semantic and non-semantic shifts. We find that: (1) no existing method behaves well in both settings; (2) fine-tuning PLMs on in-distribution data benefits detecting semantic shifts but severely deteriorates detecting non-semantic shifts, which can be attributed to the distortion of task-agnostic features. To alleviate the issue, we present a simple yet effective general OOD score named GNOME that integrates the confidence scores derived from the task-agnostic and task-specific representations. Experiments show that GNOME works well in both semantic and non-semantic shift scenarios, and further brings significant improvement on two cross-task benchmarks where both kinds of shifts simultaneously take place. Our code is available at https://github.com/lancopku/GNOME.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑