Improving Large Language Model Safety with Contrastive Representation Learning

要約

大規模な言語モデル(LLM)は、社会的影響を深める強力なツールですが、多様で制御されていない入力に対する応答を生成する能力により、敵対的な攻撃に対して脆弱になります。
既存の防御はしばしばさまざまな攻撃タイプ全体で一般化するのに苦労していますが、最近の代表工学の進歩は有望な代替案を提供します。
この作業では、モデル防御を対照的な表現学習(CRL)問題として定式化する防御フレームワークを提案します。
私たちのメソッドは、良性表現と有害な表現の分離を促進するために、トリプレットベースの損失と敵対的なハードネガティブマイニングを組み合わせたモデルをFinetunesにします。
複数のモデルにわたる実験結果は、私たちのアプローチが事前の表現エンジニアリングベースの防御を上回り、標準パフォーマンスを損なうことなく入力レベルと埋め込みスペース攻撃の両方に対する堅牢性を改善することを示しています。
私たちのコードは、https://github.com/samuelsimko/crl-llm-defenseで入手できます

要約(オリジナル)

Large Language Models (LLMs) are powerful tools with profound societal impacts, yet their ability to generate responses to diverse and uncontrolled inputs leaves them vulnerable to adversarial attacks. While existing defenses often struggle to generalize across varying attack types, recent advancements in representation engineering offer promising alternatives. In this work, we propose a defense framework that formulates model defense as a contrastive representation learning (CRL) problem. Our method finetunes a model using a triplet-based loss combined with adversarial hard negative mining to encourage separation between benign and harmful representations. Our experimental results across multiple models demonstrate that our approach outperforms prior representation engineering-based defenses, improving robustness against both input-level and embedding-space attacks without compromising standard performance. Our code is available at https://github.com/samuelsimko/crl-llm-defense

arxiv情報

著者 Samuel Simko,Mrinmaya Sachan,Bernhard Schölkopf,Zhijing Jin
発行日 2025-06-13 16:42:09+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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