Are All Prompt Components Value-Neutral? Understanding the Heterogeneous Adversarial Robustness of Dissected Prompt in Large Language Models

📄 arXiv: 2508.01554v1 📥 PDF

作者: Yujia Zheng, Tianhao Li, Haotian Huang, Tianyu Zeng, Jingyu Lu, Chuangxin Chu, Yuekai Huang, Ziyou Jiang, Qian Xiong, Yuyao Ge, Mingyang Li

分类: cs.CL, cs.AI, cs.CR

发布日期: 2025-08-03

🔗 代码/项目: GITHUB


💡 一句话要点

提出PromptAnatomy框架以解决提示组件对抗鲁棒性评估问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 对抗攻击 大型语言模型 提示工程 鲁棒性评估 结构异质性 自动化框架 ComPerturb 自然语言处理

📋 核心要点

  1. 现有方法如PromptRobust假设提示是价值中立的,未能考虑提示组件的异质性,导致对抗鲁棒性评估不准确。
  2. 本文提出PromptAnatomy框架,通过解析提示为功能组件,利用ComPerturb方法选择性扰动组件,生成可解释的对抗示例。
  3. 在多个数据集和五个先进的LLM上进行的实验表明,ComPerturb在对抗攻击成功率上达到了最先进的水平,验证了提示结构意识的重要性。

📝 摘要(中文)

基于提示的对抗攻击已成为评估大型语言模型(LLMs)鲁棒性的有效手段。然而,现有方法常将提示视为单一文本,忽视其结构异质性,导致不同组件对对抗鲁棒性的贡献不均。本文提出PromptAnatomy框架,自动解析提示为功能组件,通过选择性扰动每个组件生成多样且可解释的对抗示例。为确保语言合理性并减轻分布偏移,进一步引入基于困惑度的过滤机制。通过在四个公共指令调优数据集上的广泛实验,验证了所提方法的有效性,结果显示ComPerturb在对抗攻击成功率上达到了最先进水平。

🔬 方法详解

问题定义:本文旨在解决现有对抗攻击方法在评估大型语言模型鲁棒性时未考虑提示组件异质性的问题。现有方法将提示视为单一文本,忽略了不同组件对鲁棒性的不同贡献,导致评估结果不准确。

核心思路:论文提出的核心思路是通过PromptAnatomy框架自动解析提示,将其分解为功能组件,并通过选择性扰动每个组件生成多样的对抗示例。这种方法能够更好地捕捉提示的结构特性,从而提高对抗攻击的效果。

技术框架:整体架构包括提示解析模块、对抗示例生成模块和过滤机制。提示解析模块将提示分解为多个功能组件,对抗示例生成模块利用ComPerturb方法对组件进行扰动,最后通过基于困惑度的过滤机制确保生成示例的语言合理性。

关键创新:最重要的技术创新点在于PromptAnatomy框架的提出,它能够自动解析提示并生成可解释的对抗示例,显著提高了对抗攻击的成功率。这与现有方法将提示视为单一文本的本质区别在于,考虑了提示的结构异质性。

关键设计:在关键设计上,PromptAnatomy框架采用了基于困惑度的过滤机制,以确保生成的对抗示例在语言上是合理的。此外,ComPerturb方法的选择性扰动策略也显著提升了对抗攻击的效果。具体的参数设置和损失函数设计在实验部分进行了详细描述。

📊 实验亮点

实验结果表明,ComPerturb在多个数据集上达到了最先进的对抗攻击成功率,相较于基线方法提升了显著的性能。具体而言,PromptAnatomy框架的引入使得对抗示例的生成更加有效,验证了提示结构意识的重要性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的对抗攻击评估、模型鲁棒性测试以及提示工程等。通过更精确地评估提示的对抗鲁棒性,研究者和开发者可以设计出更强大的语言模型,提升其在实际应用中的可靠性和安全性。未来,该框架还可以扩展到其他类型的模型和任务中,推动对抗学习领域的发展。

📄 摘要(原文)

Prompt-based adversarial attacks have become an effective means to assess the robustness of large language models (LLMs). However, existing approaches often treat prompts as monolithic text, overlooking their structural heterogeneity-different prompt components contribute unequally to adversarial robustness. Prior works like PromptRobust assume prompts are value-neutral, but our analysis reveals that complex, domain-specific prompts with rich structures have components with differing vulnerabilities. To address this gap, we introduce PromptAnatomy, an automated framework that dissects prompts into functional components and generates diverse, interpretable adversarial examples by selectively perturbing each component using our proposed method, ComPerturb. To ensure linguistic plausibility and mitigate distribution shifts, we further incorporate a perplexity (PPL)-based filtering mechanism. As a complementary resource, we annotate four public instruction-tuning datasets using the PromptAnatomy framework, verified through human review. Extensive experiments across these datasets and five advanced LLMs demonstrate that ComPerturb achieves state-of-the-art attack success rates. Ablation studies validate the complementary benefits of prompt dissection and PPL filtering. Our results underscore the importance of prompt structure awareness and controlled perturbation for reliable adversarial robustness evaluation in LLMs. Code and data are available at https://github.com/Yujiaaaaa/PACP.