arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.04905cs.CLcs.AI
收藏

GlitchProber:推进大语言模型中故障 token 的有效检测与缓解

GlitchProber: Advancing Effective Detection and Mitigation of Glitch Tokens in Large Language Models

Huazhong University of Science and Technology(华中科技大学);Technical University of Munich(慕尼黑工业大学);Nanyang Technological University(南洋理工大学);Beihang University(北京航空航天大学)

Zhibo Zhang, Wuxia Bai, Yuxi Li, Mark Huasong Meng, Kailong Wang, Ling Shi, Li Li, Jun Wang, Haoyu Wang

AI总结:

本文提出 GlitchProber 工具,通过分析模型中间层注意力模式与动态信息偏差,利用小规模采样和主成分分析高效检测大语言模型中的故障 token,并校正中间层异常值进行缓解,在五个开源模型上取得平均 0.86 的 F1 分数和 50.06% 的修复率。

摘要:

大语言模型(LLMs)在自然语言处理领域取得了前所未有的成功。然而,其内部机制的黑盒性质引发了许多关于其可信度和可解释性的担忧。近期研究在模型的词表空间中发现了一类异常 token,并将其命名为“故障 token”。这些 token 一旦包含在输入中,可能诱导模型产生错误、无关甚至有害的结果,严重破坏了 LLMs 的可靠性和实用性。在这项工作中,我们旨在增强对故障 token 的理解,并提出用于其检测和缓解的技术。我们首先揭示了故障 token 对 LLMs 诱发的特征,这体现在注意力模式分布和来自模型中间层的动态信息上的显著偏差。基于这些洞察,我们开发了 GlitchProber,一个用于高效故障 token 检测与缓解的工具。GlitchProber 利用小规模采样、用于加速特征提取的主成分分析,以及一个简单的分类器来实现高效的词表筛选。更进一步,GlitchProber 校正模型中间层的异常值,以缓解故障 token 的破坏性影响。在五个主流开源 LLMs 上进行评估,GlitchProber 与现有方法相比展现出更高的效率、精确率和召回率,平均 F1 分数为 0.86,平均修复率为 50.06%。GlitchProber 揭示了一条解决故障 token 所带来挑战的新路径,并启发了未来朝着更鲁棒和可解释的 LLMs 的研究。

英文摘要:

Large language models (LLMs) have achieved unprecedented success in the field of natural language processing. However, the black-box nature of their internal mechanisms has brought many concerns about their trustworthiness and interpretability. Recent research has discovered a class of abnormal tokens in the model's vocabulary space and named them "glitch tokens". Those tokens, once included in the input, may induce the model to produce incorrect, irrelevant, or even harmful results, drastically undermining the reliability and practicality of LLMs. In this work, we aim to enhance the understanding of glitch tokens and propose techniques for their detection and mitigation. We first reveal the characteristic features induced by glitch tokens on LLMs, which are evidenced by significant deviations in the distributions of attention patterns and dynamic information from intermediate model layers. Based on the insights, we develop GlitchProber, a tool for efficient glitch token detection and mitigation. GlitchProber utilizes small-scale sampling, principal component analysis for accelerated feature extraction, and a simple classifier for efficient vocabulary screening. Taking one step further, GlitchProber rectifies abnormal model intermediate layer values to mitigate the destructive effects of glitch tokens. Evaluated on five mainstream open-source LLMs, GlitchProber demonstrates higher efficiency, precision, and recall compared to existing approaches, with an average F1 score of 0.86 and an average repair rate of 50.06%. GlitchProber unveils a novel path to address the challenges posed by glitch tokens and inspires future research toward more robust and interpretable LLMs.

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

↑