Skip to main content
QUICK REVIEW

[論文レビュー] On Prompt-Driven Safeguarding for Large Language Models

Chujie Zheng, Fan Yin|arXiv (Cornell University)|Jan 31, 2024
VLSI and Analog Circuit Testing被引用数 5
ひとこと要約

本論文は、安全プロンプトが表現と拒否方向へクエリ表現を移動させることを通じてLLMのセーフガードに与える影響を分析し、DROという自動的に安全プロンプトを最適化する手法を導入します。

ABSTRACT

Prepending model inputs with safety prompts is a common practice for safeguarding large language models (LLMs) against queries with harmful intents. However, the underlying working mechanisms of safety prompts have not been unraveled yet, restricting the possibility of automatically optimizing them to improve LLM safety. In this work, we investigate how LLMs' behavior (i.e., complying with or refusing user queries) is affected by safety prompts from the perspective of model representation. We find that in the representation space, the input queries are typically moved by safety prompts in a "higher-refusal" direction, in which models become more prone to refusing to provide assistance, even when the queries are harmless. On the other hand, LLMs are naturally capable of distinguishing harmful and harmless queries without safety prompts. Inspired by these findings, we propose a method for safety prompt optimization, namely DRO (Directed Representation Optimization). Treating a safety prompt as continuous, trainable embeddings, DRO learns to move the queries' representations along or opposite the refusal direction, depending on their harmfulness. Experiments with eight LLMs on out-of-domain and jailbreak benchmarks demonstrate that DRO remarkably improves the safeguarding performance of human-crafted safety prompts, without compromising the models' general performance.

研究の動機と目的

  • 表現の観点から、安全プロンプトがLLMのセーフガードに与える影響を調査する。
  • 有害なクエリと無害なクエリの分離性および拒否ダイナミクスに関する仮説を検証する。
  • 表現空間に基づく自動的な安全プロンプト最適化法(DRO)を開発する。

提案手法

  • 表現の効果を研究するために、制御された有害/無害クエリを収集・統合する。
  • 異なる安全プロンプトの下で、 eight open-source 7B LLMs に対して PCA によるモデル表現を可視化する。
  • DRO を提案し、クエリ表現を along/refusal direction に沿って動かす連続的な安全プロンプト埋め込みを学習する;一般能力を保持する正則化項を含める。
  • 安全アンカーデータを用いて PCA で低次元表現空間をアンカー付けし、拒否方向を推定するためのロジスティック回帰を適合させる。
  • 有害クエリの拒否を高め、無害クエリの拒否を低下させるコントラスト目的で連続的な安全プロンプトを最適化する;退化を防ぐための正則化項を追加する。

実験結果

リサーチクエスチョン

  • RQ1安全プロンプトは有害性認識を改善するのか、それとも全体として拒否確率を高めるのか?
  • RQ2安全プロンプトは潜在空間における有害クエリと無害クエリの表現をどのように変えるのか?
  • RQ3連続的な安全プロンプトを最適化して、一般的なモデル能力を維持しつつセーフガードを改善できるか?
  • RQ4表現空間に測定可能な拒否方向があり、それがプロンプト最適化を導くことができるのか?

主な発見

  • 安全プロンプトはクエリ表現を類似の方向に動かし、無害なクエリであっても全体的な拒否確率を増加させる。
  • 有害/無害クエリは安全プロンプトなしでも表現空間でほぼ区別可能であり、プロンプトが主に有害性認識を高めるという考えに挑戦する。
  • DRO は out-of-domain ベンチマークでセーフガードを大幅に向上させる(例:LLaMA-2 安全プロンプトに対して AdvBench で有害クエリの適合を 10.3% から 1.4% に低減)。
  • DRO は vanilla Prompt-Tuning を上回り、AlpacaEval で測定される一般的なモデル能力を保持する。
  • 正則化は安全プロンプトを最適化する際に生成品質を保つために不可欠である。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。