atlas

Research map / Large language models / Language, safety and interpretability

On Prompt-Driven Safeguarding for Large Language Models

ICML 2024 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 6 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Analyzes how safety prompts shift LLM hidden representations toward a "refusal direction" and proposes DRO, which optimizes continuous safety prompt embeddings to move harmful/harmless query representations along/opposite that direction.

Problem

Safety prompts prepended to LLM inputs are a common lightweight safeguard, but their working mechanisms are not understood, and their effectiveness varies across prompts and models, limiting automatic optimization.

Approach

Analyze safety prompts in representation space (PCA on last-token hidden states) and find they mainly shift queries toward a "higher-refusal" direction rather than improving harmfulness recognition; then optimize continuous safety prompt embeddings with a loss on a logistic-regression refusal direction in a low-dimensional subspace, plus a regularizer keeping the orthogonal complement near the ori

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Optimize the default safety prompt with DRO rather than leave it unchangedThe eight evaluated 7B chat LLMs · MaliciousInstruct% compliance: 9.8 -> 1.6Helped
Optimize the default safety prompt with DRO rather than leave it unchangedThe eight evaluated 7B chat LLMs · AdvBench% compliance: 10.3 -> 1.4Helped
Optimize the default safety prompt with DRO rather than leave it unchangedThe eight evaluated 7B chat LLMs · Held-out harmless queries% refusal: 7.1 -> 2.0Helped
Optimize the default safety prompt with DRO rather than leave it unchangedThe eight evaluated 7B chat LLMs · AlpacaEval% win rate: 62.5 -> 63.5Helped
Use DRO instead of vanilla Prompt-TuningThe default safety prompt · MaliciousInstruct% compliance: 5.0 -> 1.6Helped
Use DRO instead of vanilla Prompt-TuningThe default safety prompt · AdvBench% compliance: 6.8 -> 1.4Helped
Use DRO instead of vanilla Prompt-TuningThe default safety prompt · AlpacaEval% win rate: 56.3 vs. 63.5Helped
Optimize the default safety prompt with DROThe eight evaluated 7B chat LLMs under GCG attack · AdvBench with GCG jailbreak% compliance: 13.3 -> 3.1Helped
Remove the refusal objective L_r (ablation)DRO · AdvBench% compliance: 1.4 -> 10.0Hurt
Remove regularization L_U (ablation)DRO · AlpacaEval% win rate: 63.5 -> 52.6Hurt
Remove the harmfulness-recognition objective L_h (ablation)DRO · MaliciousInstruct% compliance: 1.6 -> 1.8No clear effect
Replace synthetic harmful anchor queries with AdvBench queries (ablation)DRO · AlpacaEval% win rate: 63.5 -> 59.0Hurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic harmful and harmless 'How to' queries (100+100) generated with gpt-3.5-turbo AdvBench

Benchmarks: MaliciousInstruct AdvBench AlpacaEval held-out harmless query set AdvBench with GCG jailbreak

Metrics: % compliance on harmful queries % refusal on harmless queries win rate on AlpacaEval

Baselines: no prompt default safety prompt mistral safety prompt short safety prompt vanilla Prompt-Tuning (vPT)

Builds on: prompt tuning vanilla prompt-tuning AlpacaEval GCG

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy