Backdoor attacks pose a significant threat to Large Language Models (LLMs), where adversaries can embed hidden triggers to manipulate LLM's outputs. Most existing defense methods, primarily designed for classification tasks, are ineffective against the autoregressive nature and vast output space of LLMs, thereby suffering from poor performance and high latency. To address these limitations, we investigate the behavioral discrepancies between benign and backdoored LLMs in output space. We identify a critical phenomenon which we term sequence lock: a backdoored model generates the target sequence with abnormally high and consistent confidence compared to benign generation. Building on this insight, we propose ConfGuard, a lightweight and effective detection method that monitors a sliding window of token confidences to identify sequence lock. Extensive experiments demonstrate ConfGuard achieves a near 100\% true positive rate (TPR) and a negligible false positive rate (FPR) in the vast majority of cases. Crucially, the ConfGuard enables real-time detection almost without additional latency, making it a practical backdoor defense for real-world LLM deployments.


翻译:后门攻击对大型语言模型(LLMs)构成严重威胁,攻击者可通过嵌入隐藏触发器来操控LLM的输出。现有防御方法主要针对分类任务设计,难以应对LLMs的自回归特性和庞大输出空间,导致性能低下且延迟较高。为克服这些局限,我们研究了良性LLM与后门LLM在输出空间中的行为差异。我们发现了一个关键现象,称之为序列锁定:后门模型生成目标序列时,其置信度相比良性生成表现出异常高且持续稳定的特性。基于此洞察,我们提出了ConfGuard,一种轻量级高效检测方法,通过监控令牌置信度的滑动窗口来识别序列锁定现象。大量实验表明,ConfGuard在绝大多数情况下实现了接近100%的真阳性率(TPR)和可忽略的假阳性率(FPR)。关键的是,ConfGuard几乎无需额外延迟即可实现实时检测,使其成为实际LLM部署中可行的后门防御方案。

0
下载
关闭预览

相关内容

ChatAug: 利用ChatGPT进行文本数据增强
专知会员服务
81+阅读 · 2023年3月4日
【NeurIPS2019】图变换网络:Graph Transformer Network
CosFace: Large Margin Cosine Loss for Deep Face Recognition论文笔记
统计学习与视觉计算组
44+阅读 · 2018年4月25日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员