[论文解读] Certified Robustness for Large Language Models with Self-Denoising
本文提出 SelfDenoise,一种用于大型语言模型(LLMs)的认证鲁棒性框架,通过利用 LLM 本身通过掩码标记补全来去除扰动输入的噪声,从而在随机平滑的基础上实现增强。通过在预测前应用自去噪,该方法显著提升了认证半径,在 SST-2 和 Agnews 数据集上的认证鲁棒性与实际鲁棒性方面均优于现有基线方法。
Although large language models (LLMs) have achieved great success in vast real-world applications, their vulnerabilities towards noisy inputs have significantly limited their uses, especially in high-stake environments. In these contexts, it is crucial to ensure that every prediction made by large language models is stable, i.e., LLM predictions should be consistent given minor differences in the input. This largely falls into the study of certified robust LLMs, i.e., all predictions of LLM are certified to be correct in a local region around the input. Randomized smoothing has demonstrated great potential in certifying the robustness and prediction stability of LLMs. However, randomized smoothing requires adding noise to the input before model prediction, and its certification performance depends largely on the model's performance on corrupted data. As a result, its direct application to LLMs remains challenging and often results in a small certification radius. To address this issue, we take advantage of the multitasking nature of LLMs and propose to denoise the corrupted inputs with LLMs in a self-denoising manner. Different from previous works like denoised smoothing, which requires training a separate model to robustify LLM, our method enjoys far better efficiency and flexibility. Our experiment results show that our method outperforms the existing certification methods under both certified robustness and empirical robustness. The codes are available at https://github.com/UCSB-NLP-Chang/SelfDenoise.
研究动机与目标
- 为解决大型语言模型(LLMs)在输入扰动下认证鲁棒性有限的问题,特别是在高风险应用场景中。
- 克服原始随机平滑在 LLM 中性能受限的问题,其根源在于对受损输入的性能表现不佳。
- 开发一种高效、无需参数的鲁棒性增强方法,无需访问模型权重或重新训练。
- 同时提升 LLM 的认证鲁棒性(局部稳定性)与实际鲁棒性(抵抗对抗攻击的能力)。
提出的方法
- 通过随机掩码词语生成多个扰动输入,应用随机平滑方法。
- 在将扰动输入直接输入 LLM 之前,先通过提示 LLM 完成掩码标记,恢复语义连贯性,实现去噪。
- 使用去噪后的输入进行预测与认证,从而提升模型在受损输入上的表现。
- 认证依赖于多个去噪并平滑后的输入中预测结果的一致性,认证半径由一致预测的频率推导得出。
- 该方法即插即用,无需微调或架构修改,仅通过提示式推理即可适配任意 LLM。
- 自去噪机制受去噪平滑启发,但将外部去噪器替换为 LLM 本身,从而提升效率与灵活性。
实验结果
研究问题
- RQ1自去噪是否能在不进行模型微调的情况下,提升 LLM 在随机平滑下的认证鲁棒性?
- RQ2与 RanMask 和 Safer 等基线方法相比,自去噪在认证鲁棒性与实际鲁棒性方面表现如何?
- RQ3自去噪机制是否能在保持高干净准确率的同时,实现更大的认证半径?
- RQ4LLM 是否能有效充当自身扰动输入的去噪器,以稳定预测结果?
主要发现
- 在 SST-2 数据集上,SelfDenoise 在 DeepWordBug 攻击下实现了 64.5% 的实际鲁棒准确率,比第二好的方法高出 13.2%。
- 在 Agnews 数据集上,SelfDenoise 在 DeepWordBug 攻击下实现了 70.0% 的实际鲁棒准确率,比第二好的方法高出 19.7%。
- 在扰动规模 d=5% 的条件下,与 RanMask 相比,SelfDenoise 在 SST-2 上将认证准确率提升了 11.5%,在 Agnews 上提升了 26.3%。
- SelfDenoise 在 SST-2 上保持了最高的干净准确率(90.0%),同时实现了干净准确率与鲁棒性之间的最佳权衡。
- 在 TextBugger 攻击下,SelfDenoise 在 Agnews 上实现了 66.0% 的实际鲁棒准确率,比第二好的方法高出 24.5%。
- 与原始 Alpaca 模型相比,自去噪策略在 SST-2 上仅导致干净准确率下降 1.2%,但实际鲁棒准确率提升了 19.7%。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。