知彼者智:通过多样化数据合成和指令级推理学习增强大语言模型抗提示注入能力
Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning
AI总结:
本文提出InstruCoT方法,通过多样化数据合成和指令级推理学习提升大语言模型对提示注入攻击的防御能力,实验表明其在行为偏差、隐私泄露和有害输出方面显著优于基线方法。
摘要:
大型语言模型(LLM)集成应用日益普及,但面临来自提示注入(PI)攻击的严重安全漏洞。防御PI攻击面临两大难题:恶意指令可通过多种向量注入,且注入指令与上下文的语义边界不清晰,难以识别。为解决这些问题,我们提出InstruCoT,一种用于PI防御的模型增强方法,通过合成多样化训练数据和采用指令级推理学习,使LLM能够有效识别并拒绝恶意指令,无论其来源或在上下文中的位置。我们从行为偏差、隐私泄露和有害输出三个关键维度评估InstruCoT。在四个LLM上的实验结果表明,InstruCoT在所有维度上均显著优于基线方法,同时在保持实用性性能方面没有下降。
英文摘要:
Large language model (LLM)-integrated applications have become increasingly prevalent, yet face critical security vulnerabilities from prompt injection (PI) attacks. Defending against PI attacks faces two major issues: malicious instructions can be injected through diverse vectors, and injected instructions often lack clear semantic boundaries from the surrounding context, making them difficult to identify. To address these issues, we propose InstruCoT, a model enhancement method for PI defense that synthesizes diverse training data and employs instruction-level chain-of-thought fine-tuning, enabling LLMs to effectively identify and reject malicious instructions regardless of their source or position in the context. We evaluate InstruCoT across three critical dimensions: Behavior Deviation, Privacy Leakage, and Harmful Output. Experimental results across four LLMs demonstrate that InstruCoT significantly outperforms baselines in all dimensions while maintaining utility performance without degradation
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。