Skip to main content
QUICK REVIEW

[論文レビュー] Efficient Adversarial Training in LLMs with Continuous Attacks

Sophie Xhonneux, Alessandro Sordoni|arXiv (Cornell University)|May 24, 2024
Adversarial Robustness in Machine LearningComputer Science被引用数 3
ひとこと要約

本稿では、大規模言語モデル(LLMs)における連続的攻撃を埋め込み空間で用いることで、接尾語攻撃やジェイルブレイキング攻撃などの離散的攻撃に対して耐性を示し、従来手法と比較して計算コストを299倍以上削減する、効率的な adversarial training 法 C-AdvUL および C-AdvIPO を提案する。この手法は、最小限の有用性の低下で、最先端の攻撃に対して最大100%の耐性を達成する。

ABSTRACT

Large language models (LLMs) are vulnerable to adversarial attacks that can bypass their safety guardrails. In many domains, adversarial training has proven to be one of the most promising methods to reliably improve robustness against such attacks. Yet, in the context of LLMs, current methods for adversarial training are hindered by the high computational costs required to perform discrete adversarial attacks at each training iteration. We address this problem by instead calculating adversarial attacks in the continuous embedding space of the LLM, which is orders of magnitudes more efficient. We propose a fast adversarial training algorithm (C-AdvUL) composed of two losses: the first makes the model robust on continuous embedding attacks computed on an adversarial behaviour dataset; the second ensures the usefulness of the final model by fine-tuning on utility data. Moreover, we introduce C-AdvIPO, an adversarial variant of IPO that does not require utility data for adversarially robust alignment. Our empirical evaluation on five models from different families (Gemma, Phi3, Mistral, Zephyr, Llama2) and at different scales (2B, 3.8B, 7B) shows that both algorithms substantially enhance LLM robustness against discrete attacks (GCG, AutoDAN, PAIR), while maintaining utility. Our results demonstrate that robustness to continuous perturbations can extrapolate to discrete threat models. Thereby, we present a path toward scalable adversarial training algorithms for robustly aligning LLMs.

研究の動機と目的

  • LLMs における離散的 adversarial training の高い計算コストを軽減すること。これは、GCG などの高コストなトークンレベルの摂動に依存する。
  • 埋め込み空間における連続的摂動に対する耐性が、離散的自然言語攻撃(例:接尾語攻撃、ジェイルブレイキング攻撃)へ一般化するかを調査すること。
  • モデルの有用性を維持しながら耐性を向上させる効率的な adversarial training アルゴリズムの開発。
  • 安全目的に過剰適合するが、モデルの有用性を損なう flawed 評価プロトコルを同定および是正すること。
  • 計算要件を最小限に抑えることで、耐性を持つ LLM のトレーニングに伴う炭素排出量を削減すること。

提案手法

  • C-AdvUL は、有害行動データセットに対して埋め込み空間での連続的攻撃を用いた adversarial training を実施し、有用性データセットでのファインチューニングにより有用性を保持する。
  • 連続的攻撃は、埋め込み空間における摂動の最適化によって計算され、GCG などの離散的トークンレベル探索手法と比較して著しく高速である。
  • C-AdvIPO は、IPO の adversarial 変種であり、別個の有用性データセットを必要とせず、耐性と整合性を統合する。
  • この手法は二重損失目的を用いる:変種に応じて、連続的攻撃に対する耐性のための損失と、整合性または有用性のための損失。
  • 攻撃の大きさ(ε)や IPO 重み(β)といったハイパーパrameter は、耐性と有用性のバランスを取るために調整される。
  • 評価プロトコルを改訂し、安全評価と有用性評価の両方でチャットテンプレートを含めることで、安全目的への過剰適合を防ぐ。
Figure 1 : We propose continuous adversarial training (AT) to address the large computational requirements of existing discrete AT approaches [ 6 ] . We demonstrate that robustness against continuous attacks successfully extrapolates to discrete threats, such as suffix and jailbreaking attacks while
Figure 1 : We propose continuous adversarial training (AT) to address the large computational requirements of existing discrete AT approaches [ 6 ] . We demonstrate that robustness against continuous attacks successfully extrapolates to discrete threats, such as suffix and jailbreaking attacks while

実験結果

リサーチクエスチョン

  • RQ1埋め込み空間における連続的攻撃に対する耐性は、接尾語攻撃やジェイルブレイキング攻撃などの離散的自然言語攻撃へ一般化するか?
  • RQ2連続的 adversarial training は、離散的 adversarial training と同等またはそれ以上の耐性を達成しつつ、計算コストを削減できるか?
  • RQ3adversarial training における連続的攻撃の使用が、安全目的への過剰適合を引き起こし、健全な入力に対して拒否を生じさせるか?
  • RQ4C-AdvIPO のように、別個の有用性データセットを必要とせずに adversarial alignment を達成できるか?
  • RQ5ε や β といったハイパーパrameter は、連続的 adversarial training における耐性-有用性トレードオフにどのように影響するか?

主な発見

  • C-AdvUL および C-AdvIPO は、Gemma、Phi3、Mistral、Zephyr などの複数の LLM(2B〜7Bパラメータスケール)において、GCG、AutoDAN、PAIR 攻撃に対して最大100%の耐性を達成する。
  • C-AdvUL および C-AdvIPO で訓練されたモデルは、有害データセットの文法と安全目的に過剰適合する R2D2 と比較して、健全な入力に対する拒否が著しく少ない。
  • 連続的攻撃損失と GCG 損失の間には強いピアソン相関(r = 0.99、p = 0.0075)が観察され、連続的攻撃に対する耐性が離散的攻撃に対する耐性を予測できることを示している。
  • C-AdvUL は、R2D2 と比較して計算コストを少なくとも299倍削減し、LLM における adversarial training のスケーラビリティを実現する。
  • 耐性-有用性トレードオフは直感的である:ε の値が大きくなるほど、β の値が小さくなるほど、耐性は向上するが、期待どおりにわずかに有用性が低下する。
  • 本研究では、従来の評価プロトコルに深刻な欠陥が同定された:安全評価ではチャットテンプレートを用いるが、有用性評価では用いないため、誤った結果が得られ、安全目的への過剰適合が生じる。
(a) Gemma
(a) Gemma

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。