你的微调大语言模型已经是强大的分布外检测器
Your Finetuned Large Language Model is Already a Powerful Out-of-distribution Detector
AI总结:
研究提出利用预训练LLM与微调变体的似然比作为OOD检测标准,无需额外训练即可有效应用于QA等场景,提升专用模型性能。
摘要:
我们重新审视预训练大语言模型(LLM)与其微调变体之间的似然比,将其作为分布外(OOD)检测的标准。该标准的直觉在于,预训练LLM因训练数据量大而具备关于OOD数据的先验知识,一旦用分布内数据进行微调,LLM便有足够知识区分两者的差异。利用LLM的能力,我们证明似然比可作为有效的OOD检测标准。此外,我们将所提出的基于LLM的似然比应用于问答(QA)系统中检测OOD问题,以提升专用LLM在通用问题上的性能。鉴于似然可通过现代神经网络框架中的损失函数轻松获得,在实践中实现该方法十分直接。由于预训练LLM及其各种微调模型可从Hugging Face等在线平台广泛获取,所提标准无需进一步训练即可轻松用于OOD检测。我们在远OOD、近OOD、垃圾检测及QA场景等多种设置下进行全面评估,以证明该方法的有效性。代码见 https://github.com/andiac/LLMOODratio
英文摘要:
We revisit the likelihood ratio between a pretrained large language model (LLM) and its finetuned variant as a criterion for out-of-distribution (OOD) detection. The intuition behind such a criterion is that, the pretrained LLM has the prior knowledge about OOD data due to its large amount of training data, and once finetuned with the in-distribution data, the LLM has sufficient knowledge to distinguish their difference. Leveraging the power of LLMs, we show that, the likelihood ratio can serve as an effective OOD detection criterion. Moreover, we apply the proposed LLM-based likelihood ratio to detect OOD questions in question-answering (QA) systems, which can be used to improve the performance of specialized LLMs for general questions. Given that likelihood can be easily obtained by the loss functions within contemporary neural network frameworks, it is straightforward to implement this approach in practice. Since both the pretrained LLMs and its various finetuned models are widely available from online platforms such as Hugging Face, our proposed criterion can be effortlessly incorporated for OOD detection without the need for further training. We conduct comprehensive evaluation across on multiple settings, including far OOD, near OOD, spam detection, and QA scenarios, to demonstrate the effectiveness of the method. Code can be found at https://github.com/andiac/LLMOODratio
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。