Skip to main content
QUICK REVIEW

[论文解读] LLM Lies: Hallucinations are not Bugs, but Features as Adversarial Examples

Jia-Yu Yao, Kun-Peng Ning|arXiv (Cornell University)|Oct 2, 2023
Adversarial Robustness in Machine LearningComputer Science被引用 60
一句话总结

论文将 LLM 的幻觉作为对抗性现象来框定,并引入基于梯度的幻觉攻击(弱语义和 OoD 提示)以及一个简单的基于信息熵的防御。

ABSTRACT

Large Language Models (LLMs), including GPT-3.5, LLaMA, and PaLM, seem to be knowledgeable and able to adapt to many tasks. However, we still cannot completely trust their answers, since LLMs suffer from extbf{hallucination} extemdash fabricating non-existent facts, deceiving users with or without their awareness. However, the reasons for their existence and pervasiveness remain unclear. In this paper, we demonstrate that nonsensical prompts composed of random tokens can also elicit the LLMs to respond with hallucinations. Moreover, we provide both theoretical and experimental evidence that transformers can be manipulated to produce specific pre-define tokens by perturbing its input sequence. This phenomenon forces us to revisit that \emph{hallucination may be another view of adversarial examples}, and it shares similar characteristics with conventional adversarial examples as a basic property of LLMs. Therefore, we formalize an automatic hallucination triggering method as the extit{hallucination attack} in an adversarial way. Finally, we explore the basic properties of attacked adversarial prompts and propose a simple yet effective defense strategy. Our code is released on GitHub\footnote{https://github.com/PKU-YuanGroup/Hallucination-Attack}.

研究动机与目标

  • 促使重新把幻觉理解为超越训练数据的基本特征。
  • 将自动幻觉触发形式化为对抗性提示。
  • 开发两种攻击模式(弱语义与 OoD)以诱发预定义的幻觉。
  • 提出基于推理时熵阈值的简单防御。
  • 在开源 LLM 上评估攻击并讨论防御在实用性方面的可行性。

提出的方法

  • 将幻觉定义为与现实不一致的输出。
  • 提出一种基于梯度的标记替换策略,以最大化预定义幻觉的可能性。
  • 构建两种攻击模式:保留人类语义的弱语义提示和无意义的 OoD 提示。
  • 生成并利用幻觉数据来训练或引导攻击。
  • 在 Vicuna-7B 和 LLaMA2-7B-chat 上使用预定义指标评估攻击成功率。
  • 提出在推理时进行熵阈值防御。

实验结果

研究问题

  • RQ1随机 OoD 提示能否可靠地触发 LLMs 的预定义幻觉?
  • RQ2保留语义但进行弱语义扰动是否显著增加幻觉触发?
  • RQ3基于熵的推理防御对这些幻觉攻击是否有效?
  • RQ4Vicuna-7B 与 LLaMA2-7B-chat 在对这类攻击的易感性上有何差异?

主要发现

  • 弱语义攻击在 Vicuna-7B 上达到 92.31% 的成功率,在 LLaMA2-7B-chat 上达到 53.85%。
  • OoD 攻击在 Vicuna-7B 上达到 80.77% 的成功率,在 LLaMA2-7B-chat 上达到 30.77%。
  • 更长的 OoD 提示会提高攻击成功率(例如 30 个词令在 LLaMA2-7B-chat 上达到 65.38%。)
  • 幻觉攻击揭示了小的标记变动也能将输出改成伪造事实。
  • 基于熵的防御在某些阈值下可以降低成功攻击的召回率。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。