Certifying LLM Safety against Adversarial Prompting

要約

大規模言語モデル (LLM) は、悪意のあるトークンを入力プロンプトに追加して LLM の安全ガードレールを回避し、有害なコンテンツを生成させる敵対的攻撃に対して脆弱です。
この研究では、証明可能な安全性を保証して敵対的なプロンプトから防御するための最初のフレームワークである消去とチェックを導入します。
プロンプトが表示されると、私たちの手順はトークンを個別に消去し、安全フィルターを使用して結果のサブシーケンスを検査します。
当社の安全性証明書は、一定規模までの敵対的攻撃によって、有害なプロンプトが安全であると誤って表示されないことを保証します。
Llama 2 と DistilBERT を使用する 2 つの方法で安全フィルターを実装し、2 つの場合の消去とチェックのパフォーマンスを比較します。
私たちは 3 つの攻撃モードから防御します。 i) 敵対的なサフィックス。有害なプロンプトの最後に敵対的なシーケンスが追加されます。
ii) 敵対的挿入。敵対的シーケンスがプロンプトの中央の任意の場所に挿入されます。
iii) 敵対的注入。敵対的トークンがプロンプト内の任意の位置に (必ずしも連続したブロックとしてではなく) 挿入されます。
私たちの実験結果は、この手順が安全なプロンプトに対して良好な経験的パフォーマンスを維持しながら、有害なプロンプトに対して強力な認定された安全性保証を取得できることを示しています。
さらに、我々は 3 つの効果的な経験的防御策を提案します。 i) RandEC、消去およびチェックのランダム化されたサブサンプリング バージョン。
ii) GreedyEC は、有害なクラスのソフトマックス スコアを最大化するトークンを貪欲に消去します。
iii) GradEC は、勾配情報を使用して消去するトークンを最適化します。
貪欲座標勾配 (GCG) 攻撃アルゴリズムによって生成された敵対的なプロンプトに対するその有効性を実証します。
実験のコードは https://github.com/aounon/certified-llm-safety で入手できます。

要約(オリジナル)

Large language models (LLMs) are vulnerable to adversarial attacks that add malicious tokens to an input prompt to bypass the safety guardrails of an LLM and cause it to produce harmful content. In this work, we introduce erase-and-check, the first framework for defending against adversarial prompts with certifiable safety guarantees. Given a prompt, our procedure erases tokens individually and inspects the resulting subsequences using a safety filter. Our safety certificate guarantees that harmful prompts are not mislabeled as safe due to an adversarial attack up to a certain size. We implement the safety filter in two ways, using Llama 2 and DistilBERT, and compare the performance of erase-and-check for the two cases. We defend against three attack modes: i) adversarial suffix, where an adversarial sequence is appended at the end of a harmful prompt; ii) adversarial insertion, where the adversarial sequence is inserted anywhere in the middle of the prompt; and iii) adversarial infusion, where adversarial tokens are inserted at arbitrary positions in the prompt, not necessarily as a contiguous block. Our experimental results demonstrate that this procedure can obtain strong certified safety guarantees on harmful prompts while maintaining good empirical performance on safe prompts. Additionally, we propose three efficient empirical defenses: i) RandEC, a randomized subsampling version of erase-and-check; ii) GreedyEC, which greedily erases tokens that maximize the softmax score of the harmful class; and iii) GradEC, which uses gradient information to optimize tokens to erase. We demonstrate their effectiveness against adversarial prompts generated by the Greedy Coordinate Gradient (GCG) attack algorithm. The code for our experiments is available at https://github.com/aounon/certified-llm-safety.

arxiv情報

著者 Aounon Kumar,Chirag Agarwal,Suraj Srinivas,Aaron Jiaxun Li,Soheil Feizi,Himabindu Lakkaraju
発行日 2024-02-12 18:55:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.CR, cs.LG パーマリンク