arXiv:2510.04398cs.CLcs.AI2025-10NeurIPS被引 8

提出真实且语义一致的攻击方法,揭示大模型在自然提示下易产生幻觉

SECA: Semantically Equivalent and Coherent Attacks for Eliciting LLM Hallucinations

  • 通过语义等价与连贯性约束,生成真实可信的对抗提示
  • 在多选问答任务中攻击成功率更高,且几乎无语义偏差
  • 适用于开源与商用闭源大模型,帮助评估真实场景可靠性

大型语言模型(LLMs)在高风险领域应用日益广泛,但其常出现幻觉问题,严重影响可靠性。已有研究虽尝试通过对抗攻击诱发幻觉,但多依赖不合理的提示,如插入无意义符号或改变原意,难以反映真实场景。相比之下,计算机视觉中的对抗攻击通常基于真实图像修改。本文提出语义等价且连贯的对抗攻击(SECA),通过保持原意和语义连贯性的合理提示修改来诱发幻觉。贡献包括:(i) 将寻找真实攻击建模为带语义等价与连贯性约束的优化问题;(ii) 提出一种保持约束的零阶优化方法,有效搜索可行对抗提示;(iii) 在开放式多选问答任务上验证,SECA相比现有方法攻击成功率更高,且语义等价与连贯性误差几乎为零。实验表明,无论是开源还是商业不可微分的LLM均对合理提示变化高度敏感。代码已开源:https://github.com/Buyun-Liang/SECA。

原文摘要 · Abstract (English)

Large Language Models (LLMs) are increasingly deployed in high-risk domains. However, state-of-the-art LLMs often exhibit hallucinations, raising serious concerns about their reliability. Prior work has explored adversarial attacks to elicit hallucinations in LLMs, but these methods often rely on unrealistic prompts, either by inserting nonsensical tokens or by altering the original semantic intent. Consequently, such approaches provide limited insight into how hallucinations arise in real-world settings. In contrast, adversarial attacks in computer vision typically involve realistic modifications to input images. However, the problem of identifying realistic adversarial prompts for eliciting LLM hallucinations remains largely underexplored. To address this gap, we propose Semantically Equivalent and Coherent Attacks (SECA), which elicit hallucinations via realistic modifications to the prompt that preserve its meaning while maintaining semantic coherence. Our contributions are threefold: (i) we formulate finding realistic attacks for hallucination elicitation as a constrained optimization problem over the input prompt space under semantic equivalence and coherence constraints; (ii) we introduce a constraint-preserving zeroth-order method to effectively search for adversarial yet feasible prompts; and (iii) we demonstrate through experiments on open-ended multiple-choice question answering tasks that SECA achieves higher attack success rates while incurring almost no semantic equivalence or semantic coherence errors compared to existing methods. SECA highlights the sensitivity of both open-source and commercial gradient-inaccessible LLMs to realistic and plausible prompt variations. Code is available at https://github.com/Buyun-Liang/SECA.

大模型幻觉对抗攻击提示工程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。