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

Chain-of-Scrutiny:检测大语言模型的后门攻击

Chain-of-Scrutiny: Detecting Backdoor Attacks for Large Language Models

University of Alabama at Birmingham(阿拉巴马大学伯明翰分校);The Pennsylvania State University(宾夕法尼亚州立大学);Meta;Auburn University(阿伯丁大学)

Xi Li, Ruofan Mao, Yusen Zhang, Renze Lou, Chen Wu, Jiaqi Wang

AI总结:

针对API访问式大语言模型易受后门攻击且传统防御方案不适用的问题,提出Chain-of-Scrutiny方法,通过审查推理步骤与输出的一致性检测攻击,低成本易操作,且模型能力越强检测效果越好。

摘要:

大语言模型(LLM),尤其是通过API访问的大语言模型,已在多个领域展现出出色能力。然而,缺乏技术专业知识的用户往往会借助(不可信的)第三方服务(如提示工程)来优化其LLM使用体验,这就带来了遭受后门攻击等对抗性威胁的漏洞。被植入后门的LLM会在输入包含攻击者设置的特定“触发器”时,向用户生成恶意输出。传统防御策略最初是为小规模模型设计的,由于模型访问权限有限、计算成本高且数据需求大,并不适用于可通过API访问的LLM。为解决这些局限,我们提出Chain-of-Scrutiny(CoS,审查链)方法,它利用LLM独特的推理能力来缓解后门攻击。该方法引导LLM为给定输入生成推理步骤,并审查其与最终输出的一致性——任何不一致都表明可能存在攻击。它非常适配当前流行的仅API式LLM部署模式,能够以极低的成本和极少的数据实现检测。该方法易用且由自然语言驱动,允许非专业用户独立执行防御,同时保持透明度。我们通过在多种任务和LLM上开展的大量实验验证了CoS的有效性,结果显示,能力越强的LLM能从中获得越显著的收益。

英文摘要:

Large Language Models (LLMs), especially those accessed via APIs, have demonstrated impressive capabilities across various domains. However, users without technical expertise often turn to (untrustworthy) third-party services, such as prompt engineering, to enhance their LLM experience, creating vulnerabilities to adversarial threats like backdoor attacks. Backdoor-compromised LLMs generate malicious outputs to users when inputs contain specific "triggers" set by attackers. Traditional defense strategies, originally designed for small-scale models, are impractical for API-accessible LLMs due to limited model access, high computational costs, and data requirements. To address these limitations, we propose Chain-of-Scrutiny (CoS) which leverages LLMs' unique reasoning abilities to mitigate backdoor attacks. It guides the LLM to generate reasoning steps for a given input and scrutinizes for consistency with the final output -- any inconsistencies indicating a potential attack. It is well-suited for the popular API-only LLM deployments, enabling detection at minimal cost and with little data. User-friendly and driven by natural language, it allows non-experts to perform the defense independently while maintaining transparency. We validate the effectiveness of CoS through extensive experiments on various tasks and LLMs, with results showing greater benefits for more powerful LLMs.

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

↑