arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.04446cs.LG
收藏

针对大语言模型的采样感知对抗攻击

Sampling-aware Adversarial Attacks Against Large Language Models

Technical University of Munich(慕尼黑工业大学)

Tim Beyer, Yan Scholten, Leo Schwinn, Stephan Günnemann

AI总结:

本文提出了一种基于采样感知的对抗攻击方法,通过优化与采样资源分配提升攻击成功率和效率,揭示了采样在评估大语言模型安全性中的关键作用。

摘要:

为确保大规模部署大型语言模型(LLMs)的安全性和鲁棒性,准确评估其对抗鲁棒性至关重要。现有对抗攻击通常针对单点贪心生成中的有害响应,忽略了LLMs本质上随机的性质,并高估了鲁棒性。我们证明,为了引发有害响应,攻击过程中对模型输出进行多次采样可以补充提示优化,并成为一种强大且高效的攻击向量。通过将攻击视为优化与采样之间的资源分配问题,我们实证确定了计算最优的权衡,并证明将采样整合到现有攻击中可使成功率达到最高37%,并提高效率最高两个数量级。我们进一步分析了攻击过程中输出有害性分布如何演变,发现许多常见的优化策略对输出有害性影响不大。最后,我们引入了一个基于熵最大化的无标签证明概念目标,展示了我们的采样感知视角如何启用新的优化目标。总体而言,我们的发现确立了采样在攻击中的重要性,以准确评估和加强大规模LLM的安全性。

英文摘要:

To guarantee safe and robust deployment of large language models (LLMs) at scale, it is critical to accurately assess their adversarial robustness. Existing adversarial attacks typically target harmful responses in single-point greedy generations, overlooking the inherently stochastic nature of LLMs and overestimating robustness. We show that for the goal of eliciting harmful responses, repeated sampling of model outputs during the attack complements prompt optimization and serves as a strong and efficient attack vector. By casting attacks as a resource allocation problem between optimization and sampling, we empirically determine compute-optimal trade-offs and show that integrating sampling into existing attacks boosts success rates by up to 37\% and improves efficiency by up to two orders of magnitude. We further analyze how distributions of output harmfulness evolve during an adversarial attack, discovering that many common optimization strategies have little effect on output harmfulness. Finally, we introduce a label-free proof-of-concept objective based on entropy maximization, demonstrating how our sampling-aware perspective enables new optimization targets. Overall, our findings establish the importance of sampling in attacks to accurately assess and strengthen LLM safety at scale.

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

↑